Skip to content

Commit

Permalink
Add support for syntax highlighting of C/C++ code.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrsweet committed Nov 4, 2020
1 parent def3f0f commit e6fdbba
Show file tree
Hide file tree
Showing 5 changed files with 750 additions and 260 deletions.
26 changes: 26 additions & 0 deletions DOCUMENTATION.md
Expand Up @@ -128,6 +128,9 @@ exceptions:
- Support for `#widthNN` in image URLs to scale images to 25, 33, 50, 66, 75,
and 100% width.

- Support for the "c" and "cpp" languages for syntax highlighting in fenced
code text.

- Support for tables as used by the
[Github Flavored Markdown Spec](https://github.github.com/gfm).

Expand Down Expand Up @@ -424,6 +427,13 @@ p.code, pre, ul.code li {
padding: 10px;
page-break-inside: avoid;
}
pre.numbered code {
counter-increment: line;
}
pre.numbered code:before {
color: gray;
content: counter(line) " ";
}
a:link, a:visited {
text-decoration: none;
}
Expand Down Expand Up @@ -505,6 +515,22 @@ table.list td {
h2.title, h3.title {
border-bottom: solid 2px gray;
}
/* Syntax highlighting */
span.comment {
color: darkgreen;
}
span.directive {
color: purple;
}
span.number {
color: orange;
}
span.reserved {
color: blue;
}
span.string {
color: magenta;
}
/* Dark mode overrides */
@media (prefers-color-scheme: dark) {
body {
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -48,12 +48,12 @@ sanitizer:

TESTOPTIONS = \
--author "Michael R Sweet" \
--body DOCUMENTATION.md \
--body testfiles/body.md \
--copyright "Copyright © 2003-2019 by Michael R Sweet" \
--coverimage codedoc-256.png \
--docversion $(VERSION) \
--title "Test Documentation" \
--footer README.md
--footer DOCUMENTATION.md

test: codedoc
rm -f test.xml
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -16,6 +16,7 @@ utility.
Changes in v3.6
---------------

- Added support for syntax highlighting of C and C++ code.
- Added support for literal links (functions, types, etc.) using the "@@"
target.
- Added support for markdown-style block quotes in comments.
Expand Down

0 comments on commit e6fdbba

Please sign in to comment.