-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switching from Madoko to AsciiDoc for P4Runtime specification (#510)
* Add reference for RFC2697 in bib Signed-off-by: Dscano <[email protected]> Signed-off-by: Davide Scano <[email protected]> * Switching from Madoko to AsciiDoc for P4Runtime specification Signed-off-by: Davide Scano <[email protected]> * Addressed some comments in the PR Signed-off-by: Davide Scano <[email protected]> * Addressed some comments in the PR, part 2 Signed-off-by: Davide Scano <[email protected]> * Addressed some comments in the PR, part 3 Signed-off-by: Davide Scano <[email protected]> * Addressed some comments in the PR, part 4 Signed-off-by: Davide Scano <[email protected]> * Addressed some comments in the PR, part 5 Signed-off-by: Davide Scano <[email protected]> * Addressed some comments in the PR, part 6 Signed-off-by: Davide Scano <[email protected]> * Addressed some comments in the PR, part 7 Signed-off-by: Davide Scano <[email protected]> * Addressed some comments in the PR, part 8 Signed-off-by: Davide Scano <[email protected]> * Removed trailing whitespace. Add lint script Signed-off-by: Davide Scano <[email protected]> * Changed caption table 7 Signed-off-by: Davide Scano <[email protected]> * Fix tables caption Signed-off-by: Davide Scano <[email protected]> * Proposal to address LibreOffice comment Signed-off-by: Davide Scano <[email protected]> * Implemented proposal (a) to update image and generate via LibreOffice Signed-off-by: Davide Scano <[email protected]> * Remove rogue version from Dockerfile.asciidoc Signed-off-by: Davide Scano <[email protected]> * Fix Dockerfile.asciidoc Signed-off-by: Davide Scano <[email protected]> * README updated, and PNG, SVG images removed from the repo Signed-off-by: Davide Scano <[email protected]> * fix workflows yml Signed-off-by: Dscano <[email protected]> * fix Dockerfile.asciidoc Signed-off-by: Dscano <[email protected]> * Fix the Dockerfile.asciidoc by adding the time. Correct typos in README.md. Signed-off-by: Dscano <[email protected]> * Address issue 528, used correct markup for em-dashes Signed-off-by: Dscano <[email protected]> * Address issue 529, fix incorrect markup for creating links in Asciidoc output Signed-off-by: Dscano <[email protected]> * Proposal issue 525, Some odd syntax highlighting in some code blocks Signed-off-by: Dscano <[email protected]> * Fix trailing whitespace Signed-off-by: Dscano <[email protected]> * Fix trailing whitespace Signed-off-by: Dscano <[email protected]> * Proposal issue 524, fix PDF numbered lists Signed-off-by: Dscano <[email protected]> * Proposal issue 523, fix PDF to avoid breaking bullet items, titles and codes Signed-off-by: Dscano <[email protected]> * Fix issue 522, removed negative indentation Signed-off-by: Dscano <[email protected]> * Fix issue 527, rendering of inline code improved Signed-off-by: Dscano <[email protected]> * Centered images and table captions in HTML Signed-off-by: Dscano <[email protected]> * Add LibreOffice to the Dockerfile and include a new make command. Signed-off-by: Dscano <[email protected]> * Suggest a make command Signed-off-by: Dscano <[email protected]> * Add to Makefile png and svg images generation Signed-off-by: Dscano <[email protected]> * Add images dependencies to Makefile Signed-off-by: Dscano <[email protected]> * Add a Makefile to locally generate the Docker image for AsciiDoc Signed-off-by: Dscano <[email protected]> * Fix scep.yml Signed-off-by: Dscano <[email protected]> * Fix scep.yml second tentative Signed-off-by: Dscano <[email protected]> * Fix scep.yml removed ls Signed-off-by: Dscano <[email protected]> * Add spec check in scep.yml Signed-off-by: Dscano <[email protected]> --------- Signed-off-by: Dscano <[email protected]> Signed-off-by: Davide Scano <[email protected]>
- Loading branch information
Showing
49 changed files
with
2,604 additions
and
1,948 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ jobs: | |
fetch-depth: 0 | ||
- name: Build spec | ||
run: | | ||
docker run -v `pwd`/docs/v1:/usr/src/p4-spec p4lang/p4rt-madoko:latest make | ||
docker run -v `pwd`/docs/v1:/usr/src/p4-spec p4lang/p4rt-asciidoc :latest make | ||
ls docs/v1/build | ||
- name: Upload spec to S3 | ||
uses: jakejarvis/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ jobs: | |
fetch-depth: 0 | ||
- name: Build spec | ||
run: | | ||
docker run -v `pwd`/docs/v1:/usr/src/p4-spec p4lang/p4rt-madoko:latest make | ||
docker run -v `pwd`/docs/v1:/usr/src/p4-spec p4lang/p4rt-asciidoc :latest make | ||
ls docs/v1/build | ||
- name: Upload spec to S3 | ||
uses: jakejarvis/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM ruby:3.3.5 | ||
LABEL maintainer="P4 API Working Group <p4-dev@lists.p4.org>" | ||
LABEL description="Dockerfile used for building the asciidoc specification" | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y cmake flex bison libglib2.0-dev libcairo2-dev libpango1.0-dev libxml2-dev libwebp-dev libzstd-dev libgdk-pixbuf-2.0-dev time | ||
|
||
RUN apt-get install -y libreoffice && \ | ||
gem install asciidoctor && \ | ||
echo 'gem: --no-document' > /etc/gemrc && \ | ||
gem install nokogiri && \ | ||
gem install rghost && \ | ||
gem install asciidoctor-diagram && \ | ||
gem install asciidoctor-plantuml && \ | ||
gem install asciidoctor-pdf --version 2.3.19 && \ | ||
gem install asciidoctor-pdf-cjk && \ | ||
gem install asciidoctor-lists --version 1.1.2 && \ | ||
gem install coderay pygments.rb thread_safe && \ | ||
gem install slim && \ | ||
gem install concurrent-ruby && \ | ||
gem install haml tilt && \ | ||
gem install asciidoctor-mathematical && \ | ||
gem install asciidoctor-bibtex &&\ | ||
git clone https://github.com/rouge-ruby/rouge &&\ | ||
cd rouge && \ | ||
git log -n 1 | cat && \ | ||
gem build rouge.gemspec && \ | ||
gem install rouge | ||
|
||
VOLUME ["/usr/src/p4-spec"] | ||
WORKDIR /usr/src/p4-spec |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
all: | ||
docker build -t p4rt-asciidoc -f Dockerfile.asciidoc . | ||
docker tag p4rt-asciidoc p4lang/p4rt-asciidoc:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,32 @@ | ||
|
||
SPEC=P4Runtime-Spec | ||
|
||
all: html pdf build | ||
ROUGE_STYLE=github | ||
ROUGE_CSS=style | ||
|
||
all: ${SPEC}.pdf ${SPEC}.html | ||
|
||
build: | ||
mkdir -p build | ||
|
||
# Note: Brute-force image rendering; could use more precise file-by-file make rules | ||
images: build assets/*.odg | ||
soffice --convert-to svg --outdir build assets/*.odg > /dev/null 2>&1 | ||
soffice --convert-to png --outdir build assets/*.odg > /dev/null 2>&1 | ||
${SPEC}.pdf: ${SPEC}.adoc images | ||
time asciidoctor-pdf -v \ | ||
-a pdf-fontsdir=resources/fonts \ | ||
-r asciidoctor-mathematical \ | ||
-r asciidoctor-bibtex \ | ||
-r asciidoctor-lists \ | ||
-a rouge-style=$(ROUGE_STYLE) $< | ||
|
||
html: ${SPEC}.mdk p4.json assets/* images | ||
madoko -vv --png --odir=build ${SPEC}.mdk | ||
${SPEC}.html: ${SPEC}.adoc images | ||
time asciidoctor -v \ | ||
-r asciidoctor-mathematical \ | ||
-r asciidoctor-bibtex \ | ||
-r asciidoctor-lists \ | ||
-a rouge-css=$(ROUGE_CSS) $< | ||
|
||
pdf: ${SPEC}.mdk p4.json assets/* images | ||
madoko --pdf -vv --png --odir=build $< | ||
images: | ||
soffice --convert-to svg --outdir resources/figs resources/figs/*.odg > /dev/null 2>&1 | ||
soffice --convert-to png --outdir resources/figs resources/figs/*.odg > /dev/null 2>&1 | ||
|
||
build_spec_with_images: images all | ||
|
||
clean: | ||
${RM} -rf build | ||
/bin/rm -f ${SPEC}.pdf ${SPEC}.html |
Oops, something went wrong.