-
Notifications
You must be signed in to change notification settings - Fork 3
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
Discussion: What data formats / structure best facilitate collaborative documentation #27
Comments
This space is fine for this.
Structured data can be versions (as the root) with various DocBase instances. It can also be a class for example, or a function, or a tag or whatever. This base metadata is required for filtering, tagging (such as deprecated marks) etc. Textual data is stuff like descriptions, be it if arguments/attributes, and maybe anything. So I would say that the JSON all it needs to do is have some way of saying that the description should be included from a markdown file and that is what should be edited in an editor (in comparison to editing the other data in a simple field) |
100% agreed. In terms of the output, a full JSON based output per version could be generated by combining the imported reference and editorial content. This would not need to be human editble friendly. |
Right, so now to the "DocBase" format as we shall call it (unless other votes come in?)
Agreed? |
With each version you can have sections, so you have a index.json which has metadata about the category and an an array of links to sub categories (since you might want to sort your sections differently than alphabetical. In our case we would have:
Within each section you can have sub sections An example JSON for the above would be notice the |
This gives great flexibility as you can have sections within sections, you can organise sub sections, you have an easy way to parse stuff and you have a generic way to include (using |
This also leaves it open for longer formats, such as one requirement to create generic docs, that are not tied to metadata. So you just have a index.md as the root and any sections underneath. |
Nice. With you. Another consideration is how cross referencing can work. So in a markdown file for description or whatever else, we might want to do something like:
Or
Etc. It would have to be up to each individual docs builder to render those references (the output could/would be entirely different for each). Would be interesting to see what other documentation systems are using syntax wise for cross referencing. I've been using ReadTheDocs for preside which uses ReStructuredText as a format. Not sure I like it per se, but does do referencing pretty well. |
I think I get you. I like the Edit: I think reference should essentially create a url of /section/section/section... so that is how you reference stuff. The latest version will be the current version and therefore no need for a path. To explain myself better: {{reference:a:b:c}} --> http://website.com/a/b/c (using the current version) Also now thinking about it, the include should be |
Absolutely - the build system should make the version that is being built available as a variable, and reference renderers could get the path to the reference passed to it pre-built with the version in it. So a particular docs builder would implement:
|
Makes sense so far. I think making this a simple format to generate and to be modular means we can we should see if there are other doc formats out there but I am guessing there are not ? |
http://sphinx-doc.org/ is what readthedocs use. It's a little too gnarly though IMO for general use. Python based and well, gnarly. It has good concepts though and build systems built in for HTML, ePub, etc. Theming it is gnarly and there don't appear to be any decent themes out there. Stealing concepts and building something using the language that is being documented I think is a positive move (so long as done a little at a time so as not to be overwhelming). |
Here's what we're doing for docs in Preside. It has a mixture of auto generated documentation (built using a hacky cfm build script triggered using CommandBox), and free form documentation: https://github.com/pixl8/Preside-CMS/tree/master/support/docs |
There are massive benefits to using ReadTheDocs if you can get over the initial RST and theming barriers.
Perhaps we'd be insane not to be using this? IDK. Struggle between losing ultimate control + free swag. I could certainly have a go at exporting to their format so that I could demo it. Should not take much. |
I did look into this but the theming was all over the place and I wasted far too much time with Sphinx that it made me hate it. Mark Drew
|
Yup ;) I wonder can we learn from the things that are good about it instead. So imagine a folder structure like this:
Those index.md files could then just be:
|
I do like the branches as versions feature though. I am sure the doc reader can do that Mark Drew
|
Agreed. |
So, if we forget about versions, we create the format, say that it is in git and then luceedocs (the reader) just checks it out and generates the docs for each branch that would be good enough. |
Here is my first pass at converting tags and functions to the new model, now I need to do that for object functions (member functions) |
Nice. Not sure this is quite right though: https://github.com/cybersonic/lucee-docpack/blob/4.5.1.000/tags/continue/description.md Reckon that should be the imported description in there...? |
I did say it was a first pass |
This would warrant its own thread for documentation / learning resources but... Just a side note on best facilitating documentation resources for Lucee, especially code examples, but would it be worth implementing Koans? I was involved in the below project with Ryan and believe it's a great resource for documenting & learning a language by writing unit tests. The code used for these tests could become part of the documentation to enrich the content. Obviously testing framework, MXUnit / TestBox + MockBox TBC but thought I'd throw this in here to get your opinion. |
+1 @nodoherty, though defo worth it's own issue / thread I think. Or better still, once the structure of the docs is clearer, some kinda pull request to have a Koans section of the docs. That would rock all kinds of awesome. Reckon Ryan would be up for porting that project over? I'd say it'd have to be testbox given that MXUnit has been taken over by Ortus and Testbox is the way of the future. |
@cybersonic re the doc-pack repo - loving the form its taking. I personally feel though that all the code should be in the one place. Import logic, source data + target build logic. This creates less of a barrier to entry for people wanting to contribute in different ways. So the form of the project might be like:
Could create generic helpers / API for the building of targets and do the main site + at least one other (pdf?) to get people started. That's my preference anyways. |
Actually, nomlicature-wise, either |
Yeah, I think docs as a root and build as how you generate it automatically. I think if we get this right the way we present it will be more important than the way we generate it. Another side note, I want to add gists as id's or user/id or something like that so that each page can have some mechanism to have gists and ids. So the the JSON should reflect that (since it's metadata) |
@nodoherty That is a great idea but I think start a new thread :) maybe in the doc-pack repo? https://github.com/cybersonic/lucee-docpack/tree/4.5.1.000 |
Yeah agreed on both points, the json format definitely useful for the easy expansion of the dataset:
However, if everything is hosted in this manner on GitHub, will a Gist really be that much better than just referencing a file in the repo (keeping all the documentation in one place):
The advantage with having in the repo is that non web-based outputs of the documentation can more easily include the examples in their output. Advantage of gists is comments, syntax highlighted embed code and ability to directly run in TryCF and the like. Jury is out for me. |
The index.json at the root of the docpack interests me:
} This suggests a kind of tree based CMS who's data storage is these json files. A process that is taking this storage and outputting a finalized product, might do something like (very rough, and not the best nomlicature):
The file structure might then look like:
So that index.json represents the root page of a given folder section. Having a Thoughts? |
Actually, it might better be thought of as:
|
FYI on Koans - thanks @DominicWatson @cybersonic. Agreed Dom - format / structure needs finalising before integrating this kind of content. I'll speak to Ryan about porting the Koans we've already written. Testbox FTW too. As suggested Mark, I'll create a new issues in the doc-pack repo for the Koans stuff. Sorry to clutter this thread but just an FYI that I'll also create an issue for a DashDocs / Zeal / DevDocs.io generator too so these awesome docs can go viral :-) |
Don't create an issue, create a pull request :p |
@cybersonic so I've been playing a bit more and have a working prototype of the concepts talked about. A very rough static output of the docs can be found here: http://prototype-luceedocs.surge.sh/ <- should be available some time soon - CDN just 'propagating' I've basically been playing with how the source might be laid out and how we could go about building the output docs (the page templates and layouts would need plenty more work). Stuff I think is cool:
Stuff that's not there:
The repo is here if you're interested to see where it's at: https://github.com/DominicWatson/luceedocsbuilder/. Could be free to Skype or whatever, but only once sprogs are in bed ;) |
FYI, I've been continuing this discussion and scatting with the LAS - getting close to a point where we'll have an official repo in Bitbucket. I'd like to get to a point v soon where we have some sort of documentation committee who can work together on the docs and can be its guardians. Most importantly, it needs a strong + official lead first. The current state of the stuff I've been doing is taking it's lead from "Grav", a php based static file CMS that uses Markdown. What's good about it is that it uses very familiar concepts to most contributers. So pages are just markdown files with any meta data being driven by a little YAML at the top of the file. Reference metadata is coming directly from source. See the docs source here: https://github.com/DominicWatson/luceedocsbuilder/tree/master/docs |
There is now an official repo on BitBucket (https://bitbucket.org/lucee/documentation) which I think is important. Given that it is significantly based on your large efforts, I feel a bit cuntish working in a slightly separate direction and under the 'Lucee' name rather than your own. Would be great to have you involved if you're up for it. |
This is more of a space for discussion / input gathering than an "issue" as such. What I think the considerations are:
I already kicked off my own thoughts on here https://github.com/DominicWatson/luceedocsbuilder but there wasn't really a sensible space for feedback, hence this GH issue.
My preference is for tags and functions to have their own editorial source folder. In it, could be a number of things:
I'm in two minds re "description.md", and I understand your preference for a
.json
source (that could contain both description of the function/tag + its arguments + other things).Either way, I think the folder approach works well as it makes potential future enhancements easier to manage (thinking of multiple contexts of tags and functions for example).
Feel free to close if you think there is a better space for this.
D
The text was updated successfully, but these errors were encountered: