Skip to content
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 KSY syntax diagram generated by Docson #37

Merged
merged 4 commits into from
Jul 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
out/
raw/
pygments/
docson/
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ cache:
before_install:
- gem install asciidoctor pygments.rb
- git clone -b 2.5.2 https://github.com/pygments/pygments.git
- git clone -b v2.1.0 --depth 1 https://github.com/lbovet/docson.git

script:
- make
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ TARGETS=\
out/developers_intro.html \
out/faq.html \
out/ksy_reference.html \
out/ksy_diagram.html \
out/lang_cpp_stl.html \
out/lang_java.html \
out/lang_javascript.html \
Expand All @@ -24,6 +25,9 @@ all: $(TARGETS)
rm -rf out/img
cp -r img styles js out
cp raw/pygments-default.css out/styles
cp -r docson/public/docson.js docson/public/lib/ out/js
cp -r docson/public/templates out
cp docson/public/css/docson.css out/styles

out/%.html: raw/%.html tmpl/navbar.html postprocess-html
./postprocess-html $< $@
Expand Down
Binary file added img/ajax-loader.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* <<user_guide.adoc#,User guide>>
* <<ksy_style_guide.adoc#,KSY style guide>> — best practices in creation of robust KSY specs
* <<ksy_reference.adoc#,KSY language reference>>
* <<ksy_diagram.adoc#,KSY syntax diagram>>
* <<faq.adoc#,FAQ>> — frequently asked questions
* https://github.com/kaitai-io/awesome-kaitai[awesome-kaitai] — A list of Kaitai Struct tools and resources

Expand Down
15 changes: 15 additions & 0 deletions ksy_diagram-docinfo-footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<script src="js/lib/require.js"></script>
<script>
require.config({ baseUrl: "js"});
require(["docson"], function(docson) {
$(function() {
var schemaUrl = "https://raw.githubusercontent.com/kaitai-io/ksy_schema/master/ksy_schema.json";
$.getJSON(schemaUrl).done(function(schema) {
docson.templateBaseUrl = "templates";
docson.doc("doc", schema).done(function() {
$("#wait-for-diagram").hide(1000);
});
});
});
});
</script>
6 changes: 6 additions & 0 deletions ksy_diagram-docinfo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<link rel="stylesheet" href="styles/docson.css">
<style>
.ajax-loader {
margin: 0 0.3em;
}
</style>
13 changes: 13 additions & 0 deletions ksy_diagram.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
= Kaitai Struct: KSY syntax diagram

Here you can examine the KSY syntax diagram describing all YAML keys that can be used in the Kaitai Struct YAML spec (KSY).

[#wait-for-diagram]
[NOTE]
====
Please wait a few seconds for the diagram below to render... [.ajax-loader]#image:img/ajax-loader.gif[Loading\..., 24, 24]#
====

++++
<div id="doc"></div>
++++