-
Notifications
You must be signed in to change notification settings - Fork 7
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
support directly markdown files #8
Comments
I wanted to write down my nodes for Godot and Nim and maybe publish them, since they are all mostly text with some code sprinkled in I'd like to try out this, but I'd need to have markdown support directly. And since this looks fairly simple(dangerous words), if you want I can try to whip out a PR? |
yep, thanks, welcome to give it a go! you might want to start from the work done in #11 (should be merged soon enough). it basically mean you will need to add code in the probably something like this could already work inside the proc (given proc ...
nbInit # will the nimibCustomSwitch be needed or we want to include it directly here?
nbText mdfilename.readFile
nbDoc.filename = mdfilename
nbSave |
I currently have proc mdPublish*(entry: Entry) =
nbInit
nbText entry.path.readFile
nbDoc.filename = entry.path.extractFilename
nbSave this as an implementation but I'm getting the following error:
Can |
|
With @Clonkk's idea of init procs instead of include it would be possible though: pietroppeter/nimib#45 Not really sure how to workaround it for now 🤔 |
I can just call |
the issue is not I think a workaround for now would be the protect the |
Ah that makes sense now, includes just copy-paste 🤦 Ugly solutions are always nice 🤣 |
well, my workaround is probably cleaner for the types file but messier to implement. the one you suggest it could mess up other things, but if it works, I am tempted to say, go with this, we need to sort the |
mmh, although my guess is that your workaround will create problems the moment you add a second md file (it will put a global |
The easiest solution would be to generate a Nim file with valid Nimib code from parsing the markdown file. Then you compile, execute and delete the Nim file. That way, markdown follow the same process as Nimib file and you don't have to deal with init for now |
thinking some more I think we probably could remove the nbPostInit mess already here, without waiting for changes to happen upstream in nimib. I will try to come up with something (or describe better the problem) later this evening. |
After some messing around it seems that my wrong solution also causes a recursive dependency error:
|
ok, nimibPostInit removed with #15 |
most of the discussion on this happened on nim discord #science channel, to summarize:
sorry, @zetashift to have you work on this and then finally commit myself! |
a normal markdown file (with no need to run nim code) could generate an html directly.
The change should be in
nimibook.publish
and we could thus support the followingThe text was updated successfully, but these errors were encountered: