-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add documentation tests #465
Comments
Instead of performing rudimentary text processing just yet, one thing I was thinking of was to run pandoc on the output and get all code blocks. We can tag code blocks with an attribute like We can match the compilation output against This is a pretty hacky approach and I was messing around with this using pandoc and jq and it seems doable pretty quickly. Alternatively, use something like https://github.com/hoedown/hoedown and build a zig program around this. A bit more work here though and I need to check how/if we can attach attributes to code blocks if following this. |
I think if we didn't add any new dependencies I'd be up for this going into 0.1.0. If we want to make the build depend on more stuff let's push it to 0.2.0. |
I think we should aim for doing this without dependencies, but still for the 0.2.0 since it isn't a hugely visible change from the user perspective. |
Still for the 0.1.0 you mean? I'm ok with that. |
I meant the 0.2.0, but I'll see where I get with this markdown parser and get back to you. |
Alright I'm ok with either, you can make the call. |
@tiehuis would you be terribly offended if I ignored the markdown pull request for now and made a tool in zig that did the above bullet points? I think it would be nice to only depend on zig once we have the compiler built. |
Not at all, go ahead. I've started a markdown parser here but it'll be a while before it gets to the state of parsing the entirety of that file anyway. |
I started working on #465 and made some corresponding std.io API changes. New structs: * std.io.FileInStream * std.io.FileOutStream * std.io.BufferedOutStream * std.io.BufferedInStream Removed: * std.io.File.in_stream * std.io.File.out_stream Now instead of &file.out_stream or &file.in_stream to get access to the stream API for a file, you get it like this: var file_in_stream = io.FileInStream.init(&file); const in_stream = &file_in_stream.stream; var file_out_stream = io.FileOutStream.init(&file); const out_stream = &file_out_stream.stream; This is evidence that we might not need any OOP features - See #130.
I have this working and integrated into the build system. It generates the table of contents and the "see also" sections, but I haven't made it do code snippets yet. I'm thinking something like this:
And then we'd have a table of id_names mapped to source code snippets with metadata. Or maybe even allow embedding it:
|
Great! Embedding would be great. I see the snippets anyway as first and foremost documentation, the testing is just to ensure they are always up to date. We would have a lot anyway and it'd save context switching. |
update docs examples which use build-exe to be tested See #465
Summarised from here #452.
The text was updated successfully, but these errors were encountered: