I'm creating a Wordpress-theme using HTML, PHP and SASS. The SASS-files compiles to a folder called 'css', but since I'm creating a Wordpress theme WP demands that the style.css file is located in the same folder as the other theme files.
This is my folder structure:
Now what I want is to change the compile-settings so that the style.css file gets located in the teamtour-folder and not the css-folder without manually moving it from the css-folder everytime I save, whereas the other scss-files stays in the css-folder. The easiest thing to do is just compile every sass-file to the teamtour-folder, I know, and this question can only be trivial, but I still want to have an organized folder structure.
I use NetBeans as IDE
This is not doable by the default Less/Scss support in NetBeans, the mapping is folder based (although I believe there is some bug/enhancement reported for file based mapping - I'll look into it).
What I would do as the easiest and quickest solution would be to:
change the mapping for Less compiler to generate css files in teamtour
have Grunt/Gulp "build (distribution) task" which would move the wanted CSS files to CSS folder
This way you can have a bit "mess" during development, but before publishing your theme, you would execute the build task and let Grunt/Gulp to clean up your structure. You can even map Grunt or Gulp task to "Build" action in NetBeans so at the end you'd only have to right click on your project and select Build.
One note: Gulp is available only in Dev builds of NetBeans
Another way to do this would be to let SASS compile all its outputs into the css directory, and reduce the main theme CSS file to a single #import statement. The downside of course is the additional HTTP request.
Another suggestion, which would reduce the number of HTTP requests, would be to have SASS compile into the theme root and #import all the other CSS files into the theme's main SCSS file. Then your theme only needs to load a single CSS file.
Wordpress demands a style.css in the themes "root" folder - it does not demand that this file is actually loaded when the theme is used. The file is only required to contain the theme name and a few other details in a comment - I suppose this setup is for legacy reasons.
I haven't used style.css for actual styles for several years, this is my "boilerplate" style.css, and it doesn't look much different when finished.
/*
Theme Name: BLANK THEME
Author: Mikk3lRo
Author URI:
Description: Blank theme
Version: 0.1
License:
Text Domain: prfx
*/
The actual stylesheet is included from a subfolder:
wp_enqueue_style('prfx_styles', get_template_directory_uri() . '/css/production.css');
Related
Whenever you want to import a js/ts file in a js file, you will always have this path suggestor like this.
But there is none for SCSS or other CSS file types. As you can see there is a scss file in the same directory but VSCode didn't suggest it for me (we can not export SCSS from JS but the image just for example, VSCode didn't suggest for me on import either).
My folder already has 1 scss file.
Is there any setting or plugin that can help me with this that I may accidentally skip when finding for one in Settings and Extensions? Thanks.
I'm expecting it to auto suggest path/file like the above image.
PAIN POINT:
Using Eclipse CDT - the launch configs I need are rather complex (little settings that are non-default values and other misc things) too many little things to remember, and easy to skip then stuff does not work. I want to be able to semi-automate this process in project makefiles.
Background:
I have multiple projects, not stored in the workspace (my users "import the project"). In some cases projects are some what generated (they are external makefile projects.
Requirement: Specifically depending on what build configuration is required the launch config needs to change/tweak, the external Makefile can do that, or I can create one launch file for each config. Or I can pre-populate them when I create the project
[example is normal development, debug/release but with unit-test variations]
The user might tweak the settings of course and want to save them.
Requirement: So that the launch files "travel with the project" - I want to check the into GIT, thus I want the .launch files kept in the same directory as the .project and .cproject files - as described here (thus they can be checked in and things are "self contained)
Store run configuration with project in Eclipse
PROBLEMS and QUESTIONS
1) Given existing launch configurations files (.launch files) in the ".project" directory, how can I browse/select from the list of existing ones that Eclipse does seem to previously know about.
{Example: Create a launch config called "FOO", copy this to "BAR", edit the BAR config file, replacing internal occurrences of FOO with BAR)
The BROWSE button in the "common" tab lets me select a directory to save but does not allow me to select an existing file
2) How can I tell eclipse File (X) is the default launch configuration for this project, or config(X) uses file(A) and config(Y) uses file (B)
3) Is there a way within the ".project" or ".config" or ".cproject" files to specify where to look for launch configurations, where to offer them?
4) Sure would be nice to have a file (or place in the .project, or .cproject) file that says: Launch configs for this project are in this directory - offer the user a list based on the files present in that directory
bottom line:
I'm sort of stuck - I can create launch files "correctly" with all required settings but I seem to have no means to tell Eclipse to use select/use them.
No amount of automation here seems to work, and I end up having to go back to manually creating and humanly forgetting settings in the project files.
Places I've looked:
Sort of the issue but not exactly
https://superuser.com/questions/521537/remove-launch-from-run-debug-drop-down-in-eclipse
Below - ARM describes the IMPORT process, but in my case all ".launch" files are grayed out and not selectable I don't know why and that is a different problem
I'd like to not make this a multi-step process - also see above about removing stale launch configs - you end up with too many launch configs in the history.
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0446h/CJADBBIA.html
There are numerous other places but all seem to be "click here" or "use this menu item" and not addressing the external file issue.
Iam using Webstorm for a project that uses coffeescript and Sass. In the navigation bar, I see coffeescript files along with the compiled js and map files. In the same way I see css files with the scss files. I want to be able to fold js and map files inside the corresponding coffee file for ease of navigation. I am not sure how to fix the settings for this. I want the same for scss and css files.
Yes,you can!
After google for hours,I find the answer.
Select such file(s)/folder(s) in Project View panel
"Help | Find Action" (Ctrl + Shift + A), activate check box for better results
Search for "run file watchers" (without quotes, obviously) and choose Run File Watchers entry.
see more:
PHPStorm - Run Filewatcher on existing files?
You cannot do this manually (i.e. any files you want at any time).
It's done automatically by File Watcher plugin. So .. if your *.coffee files are compiled in WebStorm by using File Watcher .. then it should be working/done automatically.
If you have File Watcher already set up -- delete intermediate files (.js/.map) and force run that file watcher.
Such grouping works if those extra files were generated after running File Watcher. IDE checks for new files and compares them with file watcher settings (Output paths to refresh field, I believe) -- based on that it creates such folding.
External file watcher (i.e. grunt-contrib-watch) is executed autonomous of IDE's File Watcher .. therefore such files will not be "grouped".
Related tickets (those few that I'm aware of) that ask about additional settings to be able to create such nesting/grouping manually:
http://youtrack.jetbrains.com/issue/WEB-8658
http://youtrack.jetbrains.com/issue/WEB-7635
http://youtrack.jetbrains.com/issue/IDEA-113347
UPDATE 2017/08/10:
As of 2016.3.x version such grouping/nesting is no longer relies on File Watchers -- it has special hard-coded rules for most common scenarios.
As of 2017.2 such rules are editable and available via Project View panel settings.
I want to figure out how can I put a file in the root folder of the project and use it in run time, there it will be accessible.
The problem that I have by doing that (placing the file in the root folder)-is that by default it means:
It is not in the classpath of the project.
It is not copied to the bin (output) folder.
I can’t see how my modifications of the file will affect the run process.
As I know there is a similar mechanism in eclipse that does the same:
The Plugin development project has a file-"plugin.xml" in the root folder of the project.
When you make a change in the file without building the project or copying it to the bin folder the changes take place when you run it.
example:
add an extension point in ”plugin.xml” and hit “RUN”, it will take place immediately.
Does anybody have an idea how this mechanism works in eclipse?
Edit - for clarification :
I am interested in how the launcher of eclipse Plugin development project loads\handles the "plugin.xml" file.
I assume when you say you want to put a file in a "root folder of the project" you are refering to a plugin that you are developing and then in runtime you want to get access to that file. Please don't vote me down if I did not understand that question correctly but based on my understanding here are some steps to follow:
Open your MANIFEST.MF file /MANIFEST.MF, this will oepn a multipage editor.
Click on the build tab (third from right).
This is where you specify what resources in your plugin you want the builder to include in the plugin at runtime. You will notice that plugin.xml is already checked which is why extensions get updated each time.
Check the resource on this editor page for the resource you want to be able to load and access at runtime. Behind the scenes this is updating your build.xml which the internal builder uses to figure out what sources to build/add when building/exporting the plugin.
One you have done that this is how you can get access to that file, you get the Bundle for your plugin and call the getEntryMethod with the path to your file and then open in inputstream from there you can load it as a File or whatever you want. Code example below: Hope this helps - Duncan
Bundle myBundle = Platform.getBundle("com.mycompany.myplugin.id")
InputStream in = myBundle.getEntry("/myfile.txt").openStream();
I'm new to Eclipse, having done a lot of development in Visual Studio and XCode.
When I create a C++ project in my source tree the project explorer shows all the files in that folder and sub-folders. However there are lots of unrelated files that I don't want to see.
In Visual Studio and XCode I have to manually link source code to the project. This allows me to control the clutter of the project. Non-project files are "hidden" by default, because they aren't added to the project. In Eclipse everything is added by default. It seems that you can't decouple the file system's storage from the view you see in the project explorer.
Also I have a bunch of source in my tree that I don't want to compile as part of this project. Because it's for a different platform. I can't see how to remove these files from the compile list without also removing them from the file system.
Reading the docs hasn't helped much. What am I missing here?
There are 2 parts to this solution. First file name filters can be defined as described in this post:
Eclipse: how to hide custom files in Project Explorer
2nd the remaining files that I don't want compiled can be excluded by right clicking on them and Properties -> C++ build -> Exclude resource from build.
So it's more a negative space thing. In traditional systems, you have to explicitly add code to the project. In Eclipse you have to explicitly REMOVE code from the project. I prefer the old way because sometimes you want to include code from disparate regions on the disk and that just makes the all inclusive model of eclipse break. But I guess I'll cross that bridge when I get to it. sigh