Skip to content

Commit 225bca0

Browse files
committed
build: update BUILD.md
Signed-off-by: Paul Moore <[email protected]>
1 parent 95b6c1c commit 225bca0

File tree

2 files changed

+47
-59
lines changed

2 files changed

+47
-59
lines changed

BUILD.md

Lines changed: 45 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,49 @@
1-
# Using Firefox with a Markdown Viewer
1+
# Viewing the Markdown Versions
22

3-
The Notebook \*.md files can be viewed using Firefox with the following
4-
Markdown Viewer: <https://github.com/KeithLRobertson/markdown-viewer>
3+
In addition to viewing the notebook markdown files on GitHub, the markdown
4+
files can be viewed with Firefox using the following Markdown Viewer:
55

6-
Extract from the README:
7-
8-
On Linux: Firefox may not know how to handle markdown files by default.
9-
A workaround for this is to add a new MIME type for markdown file extensions.
10-
Add the following XML to *~/.local/share/mime/packages/text-markdown.xml*:
11-
12-
```
13-
<?xml version="1.0"?>
14-
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
15-
<mime-type type="text/plain">
16-
<glob pattern="*.md"/>
17-
<glob pattern="*.mkd"/>
18-
<glob pattern="*.mkdn"/>
19-
<glob pattern="*.mdwn"/>
20-
<glob pattern="*.mdown"/>
21-
<glob pattern="*.markdown"/>
22-
</mime-type>
23-
</mime-info>
24-
```
25-
26-
Then run:
27-
28-
`update-mime-database ~/.local/share/mime`
29-
30-
<br>
31-
32-
# Build Single HTML or PDF files
33-
34-
The `Makefile` is work in progress as the PDF files produced have issues
35-
rendering complex tables and/or images to fit a page.
6+
* https://github.com/KeithLRobertson/markdown-viewer
367

37-
Pandoc is required to build the HTML version:
38-
39-
`dnf install pandoc`
40-
41-
and these build the PDF versions:
42-
43-
```
44-
dnf install weasyprint
45-
dnf install texlive
46-
```
47-
48-
Use `make html` or `make pdf`
49-
50-
The `make html` target will build *html/SELinux_Notebook.html*, then use this
51-
to produce the PDF versions.
52-
53-
The *html/SELinux_Notebook.html* renders in a brower ok, however the PDF
54-
versions have issues with either `make html` or `make pdf`, for example:
8+
Extract from the README:
559

56-
- With **--pdf-engine=weasyprint**, the larger images (e.g Figure 2) and
57-
larger tables (e.g. those in the 'Using libselinux Functions' section)
58-
are not rendered to fit page and are therefore chopped.
59-
- With **--pdf-engine=xelatex**, the more complex tables are not rendered
60-
correctly.
10+
> On Linux: Firefox may not know how to handle markdown files by default.
11+
> A workaround for this is to add a new MIME type for markdown file extensions.
12+
> Add the following XML to *~/.local/share/mime/packages/text-markdown.xml*:
13+
>
14+
> ```xml
15+
> <?xml version="1.0"?>
16+
> <mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
17+
> <mime-type type="text/plain">
18+
> <glob pattern="*.md"/>
19+
> <glob pattern="*.mkd"/>
20+
> <glob pattern="*.mkdn"/>
21+
> <glob pattern="*.mdwn"/>
22+
> <glob pattern="*.mdown"/>
23+
> <glob pattern="*.markdown"/>
24+
> </mime-type>
25+
> </mime-info>
26+
> ```
27+
>
28+
> Then run:
29+
>
30+
> % update-mime-database ~/.local/share/mime
31+
32+
# Build HTML or PDF Versions
33+
34+
The SELinux Notebook can be rendered in both HTML and PDF using the included
35+
Makefile. In order to build these versions of the notebook, "pandoc" and
36+
"weasyprint" must be installed on your system; consult your distribution
37+
documentation for information on installing these packages.
38+
39+
Once the required packages are installed can generate the PDF notebook with the
40+
following command:
41+
42+
% make pdf
43+
44+
... and the following will generate the HTML notebook:
45+
46+
% make html
47+
48+
The PDF and HTML notebooks will be generated in newly created "pdf" and "html"
49+
directories.

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,5 @@ Logo designed by [*Máirín Duffy*](http://pookstar.deviantart.com/)
6565

6666
## Building HTML/PDF Versions
6767

68-
The [**BUILD.md**](BUILD.md) file describes how to build these, however
69-
the best way to view is using a browser with a
70-
[**Markdown Viewer**](BUILD.md) addon.
68+
The [**BUILD.md**](BUILD.md) file has more information on building HTML and PDF
69+
versions of the notebook as well as alternate ways to view the source markdown.

0 commit comments

Comments
 (0)