|
1 | | -# Using Firefox with a Markdown Viewer |
| 1 | +# Viewing the Markdown Versions |
2 | 2 |
|
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: |
5 | 5 |
|
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 |
36 | 7 |
|
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: |
55 | 9 |
|
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. |
0 commit comments