Unit test: highlightjs.001
This is a test for syntax highlighting with highlight.js.
Program listings are highlighted and numbered by default:
#!/usr/bin/env python3
"""This is yet another link checker. Was it better to write my own
than find an existing cross-platform version? Maybe not, but it
appeared to be easier."""
import re
import os
import sys
import json
import glob
import click
try:
import html5_parser
import lxml.etree
from saxonche import PySaxonProcessor
importOk = True
except ImportError:
importOk = FalseBut numbering can be turned off:
#!/usr/bin/env python3
"""This is yet another link checker. Was it better to write my own
than find an existing cross-platform version? Maybe not, but it
appeared to be easier."""
import re
import os
import sys
import json
import glob
import click
try:
import html5_parser
import lxml.etree
from saxonche import PySaxonProcessor
importOk = True
except ImportError:
importOk = FalseAnd so can highlighting. The most reliable way to disable highlighting
is to remove the language attribute from the listing.
#!/usr/bin/env python3
"""This is yet another link checker. Was it better to write my own
than find an existing cross-platform version? Maybe not, but it
appeared to be easier."""
import re
import os
import sys
import json
import glob
import click
try:
import html5_parser
import lxml.etree
from saxonche import PySaxonProcessor
importOk = True
except ImportError:
importOk = FalseIt doesn’t appear that highlightjs-line-numbers adds
line numbers to listings that aren’t highlighted. I guess that makes sense.
Using the value text seems to work and might be a good
$verbatim-default-language if you’re using
highlight.js.
#!/usr/bin/env python3
"""This is yet another link checker. Was it better to write my own
than find an existing cross-platform version? Maybe not, but it
appeared to be easier."""
import re
import os
import sys
import json
import glob
import click
try:
import html5_parser
import lxml.etree
from saxonche import PySaxonProcessor
importOk = True
except ImportError:
importOk = False