-
Notifications
You must be signed in to change notification settings - Fork 11
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
Move examples from sdf.md to examples directory #118
Conversation
These days, I usually do the inverse, keeping the examples in the .md and extracting them by a Makefile target like
But this works for me, too.
|
Thank you, @cabo, that looks quite promising :) I tried to incorporate your suggestion via the latest commits. A few questions here, though:
|
The extractor currently does not process the JSON fragments.
I don't think so -- these do not get edited in the .md like the examples do, so editing them externally is the right way. Even more so for the generated JSO files.
Very good question. Right now the tool is rather conservative on what it allows in a file name; that needs to be adjusted a bit so the sourcecode-name attributes actually survive as file names when chosen reasonably. |
Thank you for your feedback and for opening cabo/kramdown-rfc#206 :) I now adjusted the Makefile so that only the named JSON listings from the document are kept in the In this regard, I was wondering if the addition of an option for limiting the source code extraction to listings with a |
I'm a bit lazy and simply only check in those parts of the sourcecode directory that I want to have under separate sourcecode control. (You can put |
Oh, very good point, that is definitely the simplest approach here :) |
Makefile
Outdated
@@ -0,0 +1,9 @@ | |||
render: sdf.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs all the included files as dependencies:
1706:{::include sdf-framework.cddl}
1721:{::include sdf.jso.json-unidiff}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed now via 8cd0cb7 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Makefile will likely be overwritten once this repo fully adopts the i-d-template.
(And it needs the dependencies I mentioned below.)
Otherwise, quite useful update!
Thank you for the review and the feedback, I think the PR should now be ready then :) I guess given the commit history, "Squash and merge" would probably be the best way of merging here – or should I squash the commits manually before merging? |
As a first step towards the resolution of #33, this PR proposes moving the "full" examples contained in
sdf.md
to anexamples
directory, where they are imported from. Based on these changes, a validation pipeline could be set up in a future PR.For now, only complete SDF models are extracted from the
sdf.md
file – let me know if it would make sense to also add some of the example fragments as external files.Besides regenerating (to ensure that the output stays the same), I also added the
.refcache
directory to the.gitignore
file to avoid accidentally committing any reference files downloaded during the rendering process.