-
Notifications
You must be signed in to change notification settings - Fork 90
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
Switching from Madoko to AsciiDoc for P4Runtime specification #510
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Dscano <[email protected]> Signed-off-by: Davide Scano <[email protected]>
Signed-off-by: Davide Scano <[email protected]>
I tried
Note the capitalization of the I would recommend leaving the Makefile as it is now, and renaming the |
The file logo.png is missing. |
Need to update the markup for the URL at the end of Section 1 -- in the PDF output it shows up as https://... |
At least some cross-references to figures are rendered in PDF as "Figure Figure 1". In Madoko it was necessary to say "Figure [#crossref-tag]" in the source, but the "Figure" is redundant in AsciiDoc. Similarly for section and table references. |
In the first paragraph of Section 4, a sentence in the PDF ends with "are described in a laterChapter 5." It would be better if it were "are described in Chapter 5". Either that or if "later chapter" were a link to Chapter 5, like I see for some other cross-references. |
Most or all of the figures could use some tweaking on the percent of the column width they occupy, to make them smaller. See the P4 language spec AsciiDoc source for examples. |
You use |
The paragraph at the end of Section 6.4.3 ActionProfile looks blank in the PDF, probably because in the source it has spaces at the beginning of each line. Something should be done to improve that, probably deleting those leading spaces so the text comes out as a normal paragraph after the bullet list. It is not clear to me, but perhaps those spaces were there intending for that text to be part of the last bullet, or something like that? If so, there are probably different markups in AsciiDoc that can achieve that, but given that it looks like a separate paragraph in the current Madoko PDF output, making it look like a separate paragraph in the AsciiDoc PDF output is a good start. Similarly for some text inside a bullet list in the section with title "Meter & DirectMeter". Also for a bullet list in the section with title "Batch Atomicity". I experimented in a few places with ways to achieve this in the P4 language spec AsciiDoc source. I don't recall exactly which parts right now, but if you have trouble finding examples of it, let me know and I can try to find them. In the P4-16-spec.adoc file, search for the string "interface of a Match-Action" for an example of using a line containing only Here is some AsciiDoctor documentation on this topic: https://docs.asciidoctor.org/asciidoc/latest/lists/continuation/ |
Compare the section heading "depths" of all section headings in the current Madoko PDF output, and the AsciiDoc PDF output. At least "Counter & DirectCounter" is Section 6.4.4 in Madoko PDF output, but Section 6.5 in AsciiDoc PDF output. |
In the section titled "Extern", need whitespace after "reserved range" and before the range. |
In one of the markups that should be "cite:", it is misspelled "cte:" |
In the section titled "Bytestrings" there are some LaTeX math formulas. There are a few such formulas in the P4 language spec, too, that I was able to get to render properly using AsciiDoc. Search for occurrences of "latexmath" in the P4 language spec AsciiDoc source for examples. |
There is at least one remaining occurrence of |
One cross-reference with text |
There is an occurrence of " |
Probably most occurrences of using |
The section heading for the section named "Examples of There is also an old Madoko-style cross-reference markup on the line before that. Similarly for section heading "Changes in v1.3.0" |
In the section "Changes in v1.4.0", the first sub-bullet item under "Actions" needs to be nested one level deeper. |
In section "P4Runtime Entries files" the sequence of bash commands needs different markup. Not sure, but maybe |
Signed-off-by: Davide Scano <[email protected]>
FYI, the comments were I "react" with a thumbs-up have been addressed in c43d938 |
Great! Please let me know when you are ready for another round of review, i.e. when for each review comment you have either made changes, or replied in some way that you believe no changes are needed. |
I applied it to a few proto code blocks (such as 6.1.2) so we can compare and see how it looks. |
@smolkaj I'm OK with merging now and following up with the minor issues as time allows; wdyt? |
I believe I have captured all of the net-yet-resolved comments on this PR in their own separate issues on this repo. All of them have had the new label "asciidoc-issue" added to them. |
Thanks, I saw that. Waiting for @smolkaj 's opinion, I'm ready to merge if he is. |
.github/workflows/spec.yml
Outdated
@@ -11,19 +11,19 @@ on: | |||
- '*-dev' | |||
|
|||
jobs: | |||
madoko-lint: | |||
asciidoc -lint: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the space between asciidoc
and -lint
is causing this failure: https://github.com/p4lang/p4runtime/actions/runs/12320523043
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check failures need to be addressed
Signed-off-by: Dscano <[email protected]>
Signed-off-by: Dscano <[email protected]>
I had to update the |
…ME.md. Signed-off-by: Dscano <[email protected]>
Signed-off-by: Dscano <[email protected]>
…c output Signed-off-by: Dscano <[email protected]>
Signed-off-by: Dscano <[email protected]>
I have resolved the issues:
I have proposed a solution for issue #525 |
Signed-off-by: Dscano <[email protected]>
Signed-off-by: Dscano <[email protected]>
|
||
build: | ||
mkdir -p build | ||
|
||
# Note: Brute-force image rendering; could use more precise file-by-file make rules | ||
images: build assets/*.odg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to restore lines like these in the Makefile, otherwise running make
in the docs/v1 directory fails to find the .svg and .png image files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, we have 2 use cases:
- If the Docker runs on a host machine, the user needs to generate the PNG images and then compile.
- If the Docker has to run on a CI server, the images must be generated within the make process or checked in beforehand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we can reduce all cases to behave in a way where whether it is a bare metal system, a VM, or a container, the Makefile has the commands that generate the .svg/.png files from the OpenOffice source files, by installing LibreOffice on the system, yes? I thought that was the preference that Chris expressed earlier, and that is why we only have the OpenOffice files checked in, not the .svg/.png files.
Even if there are cases where the .svg/.png files are sitting there, running make
with a Makefile that contains rules for generating those files will only generate them if they are needed, so I don't see only advantages to having these rules in the Makefile that can generate them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, one more quick comment, in case this is something I am confused about.
If there are any containers anywhere that anyone wants to use to generate the PDF & HTML for the P4Runtime spec, I think we should tell them: "Install LibreOffice in that container, or it won't work."
And if there is some container published by someone in the P4 community that you want to use, that installs asciidoctor, but not LibreOffice, I think we should ask them to update that container so that it does contain LibreOffice, even if LibreOffice is only needed for generating the P4Runtime spec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally agree with you. Does this mean we need to implement it for the container running in the CI environment?
I have regenerated the PDF and HTML files for the latest version of AsciiDoc input files on this PR as of 2024-Dec-24, with the commits Davide mentions above, and put them in the same place I put earlier versions, here: https://github.com/jafingerhut/learn-asciidoc/tree/main/p4runtime-spec-next/sample-generates-files I spot-checked the fixes for the em-dashes and the correct link, and they both look good to me. Thanks. |
Signed-off-by: Dscano <[email protected]>
…d codes Signed-off-by: Dscano <[email protected]>
Signed-off-by: Dscano <[email protected]>
Signed-off-by: Dscano <[email protected]>
I am currently in the process of transitioning the P4Runtime specification from Madoko to AsciiDoc. Below is an overview of the remaining tasks: