-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom output directory as command line flag #51
Comments
I do want to revise in general how paths are handled in nimib, since as we have abundantly seen in nimibook, current choices are not... great. Some kind of compile time switch on top of that to override whatever defaults we end up with could also be a good idea (I also like strdefine). Ideally I would like to revise everything first, but not to let the "better be the enemy of the good", if you come up with a working implementation for this I would proceed with a merge and release. Ah, regarding nimiBoost, you should open up the issues, I have a suggestion/remark to do there. :) |
Yes a revised Nimib would be the ultimate solution :) But I think it wouldn't be too much work fixing a patch in the mean-time so I'll see what I can do. Any suggestions for the variable name to assign the string to? (
Done! Didn't even notice it wasn't open 🙃 All improvements are welcome 😄 |
* instead of creating and injecting multiple variables (`nbDoc`, `nbBlock`, `nbHomeDir`, ...), nimib now only injects a `nb` variable that is a `NbDoc`. Some aliases are provided to minimize breakage. * handling of paths (`srcDir` and `homeDir`) is changed and is based on the presence of a new config file `nimib.toml` * command line options are now processed and can be used to skip/override the config process. Run any nimib file with option `--nbHelp` to see available options. * `nbPostInit` and `nbPreSave` customization mechanism based on includes are now removed * added `nbShow` command option to open in browser
This is something that we have had to do workarounds for in nimiBook, the fact that we don't want the output
.html
and images to be beside the.nim
files. In that case, we would like to be able to set an output directory relative to the Nimble project but it still feels a bit like jumping through hoops because we must make sure the srcDir, homeDir, etc match up to what we expect. (may not be anymore though:P)And this is also useful for nimiBoost so that one can compile and preview single
.nim
files that are located in a nimble project without having to care about the fact that it is in a nimble directory. I, therefore, suggest that we find a way to make it easier to choose these in the compile command already.The needs I have for the nimiBoost extension is to set the output dir primarily, if it has an ugly name in the header I don't care about but if it too could be fixed that would be great.
From my research the easiest approach seems to be
{.strdefine.}
variables https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compileminustime-define-pragmas . For exampleThis won't run of course but it conveys the main idea. when compiling the file we could then pass in a directory like this
-d:nbHomeDir=McDonalds/BurgerKing
and if it isn't defined we use the nimble dir.Do you see any obvious flaws with this approach?
The text was updated successfully, but these errors were encountered: