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 support for Codified VUs #2053

Closed
wants to merge 2 commits into from
Closed

Add support for Codified VUs #2053

wants to merge 2 commits into from

Conversation

ShabbyX
Copy link
Contributor

@ShabbyX ShabbyX commented Feb 10, 2023

The following is implemented in this change:

  • Codified VU parsing
  • Codified VU reformatting in source (reflow.py)
  • Codified VU formatting for build
  • Codified VU type checking
  • Unit tests

There is no mention of codified VUs in the spec text however at this point. That will be added as VUs are converted.

@ShabbyX
Copy link
Contributor Author

ShabbyX commented Feb 10, 2023

Notes:

  • This first three commits in this change have their own PRs, so only the last commit is the subject of this PR
  • The PR is a no-op from the point of view of users. Follow up PRs will officially introduce the language, convert a few VUs etc.
  • Currently, the pdf output is not styled (justified, no highlighting, not monospace). @oddhack I need your help to point me to how I can make the pdf build process [style]##something## correctly.
  • html and man pages look fine

@oddhack
Copy link
Contributor

oddhack commented Feb 15, 2023

I'd like to avoid preprocessing the entire spec before building. Having asciidoctor itself call out to the VU generator from an extension will make life easier for most users, particularly when there are build errors that have to be tracked back to where they're happening in the source. Asciidoctor extensions like asciidoctor-diagram do something like this today.

Re PDF themes, see config/themes/pdf-theme.yml and https://docs.asciidoctor.org/pdf-converter/latest/theme/ for docs. It is unlike CSS and very limited, but you can do some basic stuff.

The reflow code traversed asciidoc files and modified them.  The logic
to traverse the files is split into its own class for future reuse.
@ShabbyX
Copy link
Contributor Author

ShabbyX commented Feb 23, 2023

I'd like to avoid preprocessing the entire spec before building. Having asciidoctor itself call out to the VU generator from an extension will make life easier for most users, particularly when there are build errors that have to be tracked back to where they're happening in the source. Asciidoctor extensions like asciidoctor-diagram do something like this today.

Re PDF themes, see config/themes/pdf-theme.yml and https://docs.asciidoctor.org/pdf-converter/latest/theme/ for docs. It is unlike CSS and very limited, but you can do some basic stuff.

Thanks for the pointers. I have yet to look at creating an extension that gathers the necessary info and calls into python, but I will at some point. You are right that this can change line numbers during build and that can be annoying.

Before sorting that out (and dealing with pdf), and while we wait for the WG signing off on this direction, I'm going to spend some time sorting out the VVL side of things.

The following is implemented in this change:

- Codified VU parsing
- Codified VU reformatting in source (reflow.py)
- Codified VU formatting for build
- Codified VU type checking
- Unit tests

There is no mention of codified VUs in the spec text however at this
point.  That will be added as VUs are converted.
@ShabbyX
Copy link
Contributor Author

ShabbyX commented Mar 16, 2023

I'd like to avoid preprocessing the entire spec before building. Having asciidoctor itself call out to the VU generator from an extension will make life easier for most users, particularly when there are build errors that have to be tracked back to where they're happening in the source. Asciidoctor extensions like asciidoctor-diagram do something like this today.

Re PDF themes, see config/themes/pdf-theme.yml and https://docs.asciidoctor.org/pdf-converter/latest/theme/ for docs. It is unlike CSS and very limited, but you can do some basic stuff.

I finally got around to doing this, and with some minor asciidoctor issues worked around, I got things working. This is now building using an asciidoctor extension. It spawns and communicates with a python process to do the job of formatting the VUs.

I also got the pdf output to look decent, though somehow the bold style doesn't get applied 🤷

Per your previous request, I opened a new PR from a local branch in this repo (#2081), so I'm gonna close this one.

@ShabbyX ShabbyX closed this Mar 16, 2023
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