Skip to content

Using AsciiDoc instead of Asciidoctor to generate HTML documentation#1133

Merged
cipherboy merged 4 commits into
OpenSCAP:masterfrom
jan-cerny:asciidoctor_to_asciidoc
Jul 26, 2018
Merged

Using AsciiDoc instead of Asciidoctor to generate HTML documentation#1133
cipherboy merged 4 commits into
OpenSCAP:masterfrom
jan-cerny:asciidoctor_to_asciidoc

Conversation

@jan-cerny
Copy link
Copy Markdown
Member

@jan-cerny jan-cerny commented Jul 24, 2018

We need to be able to generate HTML documentation using Asciidoc instead of Asciidoctor, because on some systems Asciidoctor is not available.

The asciidoc command does not support certain syntax that is
supported by asciidoctor command. Fortunately, we can use syntax
that is compatible with both programs. Most notable changes are:

  • Do not use triple backquotes for monospaced text, use single
    backquotes that work in both programs.
  • Use ---- for source code listing everywhere because they
    are rendered differently in asciidoc than indented blocks,
    whereas in asciidoctor they looked the same as indented blocks.
  • Use explicit wrapping in source code listing because asciidoc
    doesn't wrap long lines implicitly in source code listings,
    which causes ugly overlows and extremely long lines that are
    hard to read.
  • Fix SSG link.

Then, we need to change CMakeLists to be able to use asciidoc.
Explicitely set the HTML5 backend because it is not default in asciidoc.
We have to make the target directory before we call the program,
because asciidoc doesn't create directories automatically.

Finally, we removed the mention of asciidoctor from Developers Manual and provided instructions to install asciidoc.

The asciidoc command does not support certain syntax that is
supported by asciidoctor command. Fortunately, we can use syntax
that is compatible with both programs. Most notable changes are:
- Do not use triple backquotes for monospaced text, use single
  backquotes that work in both programs.
- Use ---- for source code listing everywhere because they
  are rendered differently in asciidoc than indented blocks,
  whereas in asciidoctor they looked the same as indented blocks.
- Use explicit wrapping in source code listing because asciidoc
  doesn't wrap long lines implicitly in source code listings,
  which causes ugly overlows and extremely long lines that are
  hard to read.
- Fix SSG link.
Asciidoc could be used instead of asciidoctor. Changed the command line
to be compatible with both programs. Explicitely set the HTML5 backend
because it is not default in asciidoc. We have to make the target
directory before we call the program, because asciidoc doesn't create
directories automatically. If both asciidoc and asciidoctor are found,
asciidoc is preferred.
@jan-cerny jan-cerny added this to the 1.3.0_alpha2 milestone Jul 24, 2018
@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 24, 2018

Codecov Report

Merging #1133 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1133      +/-   ##
==========================================
- Coverage   63.98%   63.97%   -0.01%     
==========================================
  Files         278      278              
  Lines       46247    46247              
==========================================
- Hits        29589    29588       -1     
- Misses      16658    16659       +1
Impacted Files Coverage Δ
src/OVAL/probes/probe/worker.c 73.19% <0%> (-0.77%) ⬇️
src/OVAL/probes/independent/filehash58_probe.c 74.57% <0%> (+2.54%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 20417cd...66e14d1. Read the comment docs.

@jan-cerny
Copy link
Copy Markdown
Member Author

I am going to change this PR to use only asciidoc, not asciidoctor.

This will remove the possiblity of using asciidoctor in `make docs`
build target. We will support only asciidoc, beacuse that command
is available in many Linux distributions. Removed also a mention
of asciidoctor from the Developer Manual.
@jan-cerny jan-cerny changed the title Enable using both Asciidoctor and Asciidoc to generate HTML documentation Using AsciiDoc instead of Asciidoctor to generate HTML documentation Jul 25, 2018
@jan-cerny
Copy link
Copy Markdown
Member Author

I have updated the PR to use only asciidoc.

@cipherboy
Copy link
Copy Markdown
Member

These changes look good. :) I verified that all the code blocks look like code blocks, that it builds fine with asciidoc installed and that the new files look fine.

One question: On line 71 of the changed file you add a -- line (whereas your codeblock changes were ----)... but you didn't add them later. What do the -- do? It looks from here that it is for use in lists, but wasn't exactly sure their purpose.

I'm ACK-ing it anyways as the output file looks good, which is what matters. :P

-- Alex

@cipherboy cipherboy self-assigned this Jul 26, 2018
@jan-cerny
Copy link
Copy Markdown
Member Author

@cipherboy That is a "List Item Continuation". That allows you to put a larger block as a list item which is well indented. See section 17.7 here: http://www.methods.co.nz/asciidoc/chunked/ch17.html

@cipherboy
Copy link
Copy Markdown
Member

cipherboy commented Jul 26, 2018

Ahhh okie! :) (I missed that link the first time).

Looks good then, thanks for your changes! :)

ACK

@cipherboy cipherboy merged commit fc2a241 into OpenSCAP:master Jul 26, 2018
@jan-cerny jan-cerny deleted the asciidoctor_to_asciidoc branch July 27, 2018 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants