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

AsciiDoc conversion experiments #682

Merged
merged 110 commits into from
Jun 6, 2022

Conversation

javagl
Copy link
Contributor

@javagl javagl commented Apr 7, 2022

A DRAFT of the first experiments for converting the specification to AsciiDoc (see #590 )

@javagl javagl changed the base branch from main to draft-1.1 April 7, 2022 14:40
@javagl
Copy link
Contributor Author

javagl commented Apr 7, 2022

The current state is that it contains a specification/Specification.adoc that was largely auto-generated from the specification/README.md, and that can be used to create first, basic (not-so-pretty) PDF and HTML outputs. It also contains a BUILDING.md with some instructions for this process.

@javagl
Copy link
Contributor Author

javagl commented May 26, 2022

I'll mark this as "ready for review" now. There certainly are still some issues (probably some links not working), or possible improvements (as in ~"That's not how you do this in AsciiDoc!"), but it should currently be a reasonably consistent state.

A summary of some possibly relevant points:

  • There now is basically one README.adoc file for each former README.md
  • Basic instructions for building the specification are in BUILDING.md
    • The "root" for building the specification is Specification.adoc. It includes all README.adoc files, as well as the APPENDIX.adoc and the "properties reference" that is generated with wetzel, and contained in PropertiesReference_3dtiles.adoc and PropertiesReference_3dtiles_schema.adoc

Previews of the resulting specifications are attached here.

The PDF file was compressed (as described in the build instructions). For the HTML version, I downscaled/compressed the images, but the HTML file can just be dropped into the local 3dtiles/specification subdirectory to see it with the original images. (I didn't want to upload 90MB here, due to a slow connection).

Specification-1.1.0-compressed-2022-06-26.pdf

3d-tiles-Specification-HTML-compressedImages-2022-06-26.zip

@javagl javagl marked this pull request as ready for review May 26, 2022 14:58
Copy link
Contributor

@lilleyse lilleyse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've seen some stuff @javagl 😄

I did a high level pass to start. I plan to do a deeper pass later to help catch broken links or spot discrepancies between the .md and .adoc versions. The HTML output looks beautiful.

specification/BUILDING.md Show resolved Hide resolved
specification/Specification.adoc Outdated Show resolved Hide resolved
specification/README.adoc Show resolved Hide resolved
specification/ACKNOWLEDGEMENTS.adoc Show resolved Hide resolved
specification/Styling/README.adoc Show resolved Hide resolved
@@ -0,0 +1,3262 @@

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the property references be grouped together in a more consistent way, like tileset properties first, then tile format properties, then metadata - roughly based on the folder structure on github? I think it will be easier to follow that way.

property-reference-ordering

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now, this is listed alphabetically by the "type name", e.g.

...
  templateUri (linked)
  tile (linked)
  tile.implicitTiling (linked)
  tileset (linked)
...

Of course, abritrary other orders can be established (e.g. sorting by the "Title" - i.e. the string that is actually displayed at the end). But when it comes to "grouping" and "folders", I'll have to see how the "desired sorting" can be squeezed into wetzel - beyond the this.knownTypeNames = Object.keys(this.knownTypes).sort(); that it is doing now...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@javagl any update on this one? It doesn't need to hold up the PR, I'm just curious.

specification/directories.adoc Outdated Show resolved Hide resolved
specification/BUILDING.md Show resolved Hide resolved
Comment on lines 47 to 60
- Run the following command:
```
"C:\Program Files\gs\gs9.20\bin\gswin64.exe" ^
-dPrinted=false ^
-sDEVICE=pdfwrite ^
-dCompatibilityLevel=1.4 ^
-dPDFSETTINGS=/screen ^
-dNOPAUSE ^
-dBATCH ^
-dDetectDuplicateImages ^
-sOutputFile=Specification-1.1.0-compressed.pdf ^
Specification-1.1.0.pdf
```
(This is a Windows .BAT file. On Linux, replace the `^` with `\`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My notes on the build process on Linux:

  • I had to build Ghostscript from source since I couldn't find precompiled Linux binaries. I downloaded ghostscript-9.20-linux-x86_64.tgz, ran ./configure, then make, and that created bin/gs.
  • Have you seen this warning? I'm not sure which character it's refering to.
~/Code/3d-tiles/specification$ asciidoctor-pdf --verbose --trace --attribute scripts=cjk --attribute pdf-theme=default-with-fallback-font Specification.adoc --out-file Specification-1.1.0.pdf
asciidoctor: WARNING: Could not locate the character `⁣' (\u2063) in the following fonts: Noto Serif, M+ 1p Fallback, Noto Emoji

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw that warning, and tried to figure out where it came from, but my friggin Windows console just displayed this as "�" and did not include the info that it was \u2063, so I couldn't properly search for this. I'll take a note for that as well, the Unicode code may be helpful to figure out what this actually is... "Invisible Separator" for now, but I'll have a look...

specification/BUILDING.md Show resolved Hide resolved
@javagl
Copy link
Contributor Author

javagl commented May 27, 2022

I wrote some comments to the inlined ones, and summarize them as a short TODO list here:

  • Consider adding a title image/text with ifdef::env-github[] into the main README.adoc (right now, these are only in Specification.adoc)

  • Look at the CSS to reduce the spacing between bullet point lists and table rows

    • Looked at options, see inlined comment. GitHub preview cannot be tweaked. PDF/HTML look OK.
  • Check whether 'Acknowledgements' should be a section or appendix. Investigate AsciiDoc acknowledgments section type

    • Stay an appendix for now
  • Check if the properties reference can be sensibly "grouped" to be more similar to the folder structure

  • MAYBE move "Metadata Semantic Reference" to its own (non-normative?) section. Also see Ideas for structuring Metadata Semantics #643

    • Discussed inline: It's not "normative" for the format, thus, will stay an appendix for now
  • Investigate why the 3D Tiles logo was small in some versions of the PDF. (Maybe just an artifact from of a missing pdfwidth and some DPI changes due to the compression or so...)

    • Done. It was an "inlined" image instead of a block image. Fixed in a6dc753
  • Figure out what causes the warning WARNING: Could not locate the character ... (\u2063) ... when creating the PDF

  • Experiment with the PDF compression modes. screen is too aggressive and makes images unreadable. ebook (the one that the preview PDF was created from) seems OK. Check the lower-level options for limiting image sizes and quality.

  • OT: Replace "MIME type" with "Media Type"

@javagl
Copy link
Contributor Author

javagl commented May 29, 2022

An aside: I added the logo and an introductory sentence to the (GitHub-rendered version of the) README.adoc that is shown at https://github.com/javagl/3d-tiles/tree/asciidoc-conversion/specification . But we might consider to create a dedicated README.md for this directory. The current README.adoc that contains the actual specification text could then be something like MAIN_SPECIFICATION.adoc or so.

This new "top-level" README.md could then be something like


Specification

Hi there, look, all this is ADOC now, here's the entry point for 3D Tiles 1.1: MAIN_SPECIFICATION.md

Here are some PDF files: Specification-1.1.0.pdf ...

...


so that this directory/README.md rather serves as "the entry point" for all spec-related documents (similar to https://github.com/KhronosGroup/glTF/tree/main/specification )

(Not a strong opinion, just a thought...)

specification/BUILDING.md Outdated Show resolved Hide resolved
@lilleyse
Copy link
Contributor

This new "top-level" README.md could then be something like

Eventually this might make sense, but it is another level of indirection that I don't think is worth it right now.

@javagl
Copy link
Contributor Author

javagl commented Jun 6, 2022

The latest commits remove the now obsolete .md files, and update the links that had been pointing directly to these Markdown files from other parts of the repository. (This was mainly from the former 'next' extensions).

One thing that I remembered while doing this: Some of the Markdown documents contained a local Table Of Contents (e.g. the Metadata/README.md). These TOCs can not directly be part of the AsciiDoc files when they are supposed to be combined into a single PDF/HTML. So the Metadata/README.adoc does not contain a TOC.

Using the ifdef::env-github[] construct, we could insert a TOC that only would show up on GitHub. This may impose some maintenance effort (because these TOCs cannot be generated automatically, as it was done with the MarkdownAllInOne VS plugin). But if this is desired, I could add these TOCs. (They had all been removed in a single commit: javagl@3d49714 )

@lilleyse
Copy link
Contributor

lilleyse commented Jun 6, 2022

Let's skip the TOC for now.

@lilleyse
Copy link
Contributor

lilleyse commented Jun 6, 2022

I noticed a lot of changes when I generated the property reference with wetzel locally. Does the property reference need to be re-generated now that #688 is merged?

@javagl
Copy link
Contributor Author

javagl commented Jun 6, 2022

Indeed, the state here was generated based on a state without BinaryBodyOffset. Updated it with the latest state.

@lilleyse
Copy link
Contributor

lilleyse commented Jun 6, 2022

Thanks @javagl! A huge amount of work went into this and I'm glad to see it merged.

@lilleyse lilleyse merged commit 2e523c3 into CesiumGS:draft-1.1 Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants