diff --git a/.gitignore b/.gitignore index eb0a0b1..cdf363a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +#test result +tests/result* +tests/result* #vim session files *.vims diff --git a/ASCIIsite.py b/ASCIIsite.py index cd825c0..f0978b5 100755 --- a/ASCIIsite.py +++ b/ASCIIsite.py @@ -11,9 +11,18 @@ def parse_arguments(): parser=argparse.ArgumentParser(description='create a website directory structure by converting .adoc files in a directory strucutre to .html files.') parser.add_argument('inputDir', type=Path, help='The directory of adoc files to be copied and converted.') parser.add_argument('-o', '--output', type=Path, help='What to name the generated directory or tar file') + parser.add_argument('--stylesheet', type=Path, help='A custom CSS file to be applied to the output.') + parser.add_argument('--exclude-file', type=Path, help='A text file containing glob patterns to exclude, 1 per line.') + parser.add_argument('--exclude', nargs='+', help='A list of glob patterns to ignore. Remember to quote them so your shell doesnt escape them!') parser.add_argument('-z', '--compress', action='store_true', help='whether to compress the resulting directory to a tar.gz file. can be usefull for scripting to transfer the site to a remote server.') + parser.add_argument('-v', '--verbose', action='store_true', help='outputs debug messages onto the console.') args=parser.parse_args() + #setting log level + if args.verbose: + logging.info('setting log level to verbose') + logging.getLogger().setLevel(level=logging.DEBUG) + #set compress flag if args.output != None and not args.compress: #detect based on whether outFile has a .tar.gz filename. @@ -43,15 +52,34 @@ def parse_arguments(): logging.info(f'outputting to {outFile.resolve()}') logging.debug(f'compress is {compress}') - return args.inputDir.resolve(), outFile, compress + exclude=[] + if args.exclude_file != None: + with open(args.exclude_file, 'r') as file: + exclude=[glob.strip() for glob in file] + + if args.exclude != None: + exclude.extend(args.exclude) + + if not args.inputDir.resolve().exists(): + print(f'Inputdir {args.inputDir.resolve()} does not exist!') + exit() + + stylesheet=None + if args.stylesheet != None: + stylesheet =args.stylesheet.resolve() + logging.info(f'using stylesheet {stylesheet}') + + return args.inputDir.resolve(), outFile, stylesheet, compress, exclude #Doing it in a tmpDir first, as some distrubutions put temp files on a ramdisk. this should speed up the operation sigificantly. class TmpDir: - def __init__(self, srcDir): + def __init__(self, srcDir, exclude): self.tmpDir=tempfile.TemporaryDirectory() logging.debug(f'making tmp file from {srcDir} at {self.tmpDir.name}') self.path=self.tmpDir.name+'/'+Path(srcDir).resolve().name - self.ignorePattern=shutil.ignore_patterns('*.adoc', '.git', '.gitignore') + self.ignorePatterns=['*.adoc', '.gitignore', '.git/*'] + self.ignorePatterns.extend(exclude) + self.ignorePattern=shutil.ignore_patterns(*self.ignorePatterns) shutil.copytree(srcDir, self.path, ignore=self.ignorePattern, symlinks=False) #copy out from tmpDir (which may be in RAM, depending on distrubution) to disk @@ -73,32 +101,55 @@ class TmpDir: def find_paths_to_convert(fileNameGlob): return glob.glob(f'**/{fileNameGlob}', recursive=True) +#finds the depth of a file relative to given directory +def find_relative_file_depth (subfile, parentDir): + subfile=Path(subfile).resolve() + parentDir=Path(parentDir).resolve() + return len(subfile.parts)-len(parentDir.parts)-1 + #simple wrapper around the asciidoctor cli. -def convert_file(inDir, outDir, inFile): +def convert_file(inDir: Path, outDir: Path, inFile: Path, stylesheet: Path): + #in order for the stylesdir and imagesdir to be linked to correctly, we need to know the relative depth between the two directories. + depth=find_relative_file_depth(inFile, inDir) + logging.info(f'converting {Path(inFile).resolve()}') - logging.debug(f'converting {inFile} from directory {inDir} to directory {outDir}') - try: - #the destdir can be used instead of destfile in order to preserve the directory structure relative to the base dir. really useful. - subprocess.run(['asciidoctor', + logging.debug(f'converting {inFile=}, {outDir=}, {inDir=}, {stylesheet=}') + + depthstring= '../'*depth + + arguments=['asciidoctor', + #makes the stylesheet linked, but still includes it in the output. + '--attribute=linkcss', + f'--attribute=stylesdir={depthstring}css', + #set imagesdir + f'--attribute=imagesdir={depthstring}images', #specifies the source directory root. f'--source-dir={inDir}', #Destination dir. It takes the file from the subtree --source-dir and puts it in the equivilant location in the subtree --destination-dir. (talking about filesystem subtrees). f'--destination-dir={outDir}', - inFile], - check=True) + inFile] + + if stylesheet != None: + arguments.insert(1, f'--attribute=copycss={stylesheet}') + arguments.insert(1, f'--attribute=stylesheet={stylesheet.name}') + else: + arguments.insert(1, f'--attribute=copycss') + logging.debug(f'{arguments=}') + try: + #the destdir can be used instead of destfile in order to preserve the directory structure relative to the base dir. really useful. + subprocess.run(arguments, check=True) except Exception as e: logging.error(f'could not convert {inFile}!') - logging.error(f'stdErr was {e.stderr}') - logging.error(f'stdOut was {e.stdout}') + logging.error(f'{e}') if __name__ == '__main__': - inFile, outFile, compress=parse_arguments() + inFile, outFile, stylesheet, compress, exclude=parse_arguments() os.chdir(inFile) - tmpDir=TmpDir('./') + tmpDir=TmpDir('./', exclude) pathsToConvert=find_paths_to_convert('*.adoc') for i in pathsToConvert: - convert_file('./', tmpDir.path, i) + convert_file(inDir='./', outDir=tmpDir.path, inFile=i, stylesheet=stylesheet) if compress: tmpDir.compress_and_copy_self_to(outFile) diff --git a/README.md b/README.md index e95c43b..f4d2562 100644 --- a/README.md +++ b/README.md @@ -3,17 +3,26 @@ ![Licence](https://img.shields.io/badge/Licence-GPL-blue) ## What is it? -ASCIIsite is a simple, barebones static site generator. You give it a directory contaning asciidoctor documents and supporing media in the strucutre you want your site to be in, and it spits out a fully functional static site based on that input directory. +ASCIIsite is a simple, bare bones static site generator. You give it a directory containing asciidoctor documents and supporting media in the structure you want your site to be in, and it spits out a fully functional static site based on that input directory. ## Usage -ASCIISite takes 2 (so far) optional arguments followed by the single mandatory arument telling it what directory to convert. +ASCIISite several optional arguments followed by a single mandatory argument telling it what directory to convert. the -o or --output option simply tells ASCIISite what to name the output file. the -z or --compress flag tells ASCIISite to put the final product in a compressed tar.gz file as its output. This is especially useful if you are running ASCIISite on your personal computer, and will be uploading the tar.gz file to your server. +The --sylesheet options allows you to set a custom stylesheet to use instead of the default ASCIIDoctor stylesheet. + +The --exclude flag allows you to specify a list of glob patterns. Any file matching these glob patterns will not be copied to the output. + +The --exclude-file flag allows you to specify a file containing one glob to exclude per line. Other than inputting from a file, works exactly the same as --exclude. Note that it cannot parse the full spec of .gitignore files, only traditional globs. + +Exclusions are helpful for any files that are needed for the compilation of the asciidoc files, but do not need to be in the final site. +The main use case I am aware of is files that are put into an asciidoc document via an include statement. + As for how to format the input directory, thats up to you. The directory structure of the input will be mirrored in the structure of the output website. The only real rule you need to follow is that all your links to other pages in the input directory should be relative, so they dont get broken when you move the output directory around. @@ -23,13 +32,12 @@ Say you have a nice asciidoctor directory like this: ``` test ├── dir -│   ├── collatz.py │   └── subdir │   └── linked.adoc ├── images │   └── test_pattern.svg ├── include -│   └── include.adoc +│   └── include.txt └── landing_page.adoc ``` @@ -37,26 +45,67 @@ Where some pages link to others, some pages include others, and some pages have You can run ``` -ASCIISite.py -o result test +ASCIISite.py -o output test ``` to get a file tree like: ``` -result +output +├── css +│   └── asciidoctor.css +├── dir +│   └── subdir +│   └── linked.html +├── include +│   └── include.txt +├── images +│   └── test_pattern.svg +└── landing_page.html +``` + +If, say, the include directory is a directory needed for the asciidoc compilation, +but not needed for the final website, you can use the --exclude option to specify a list of glob patterns to exclude. For example, +```` +ASCIIsite.py --exclude 'include*' -o output test +``` + +will get you an output like: +``` +output +├── css +│   └── asciidoctor.css ├── dir -│   ├── collatz.py │   └── subdir │   └── linked.html ├── images │   └── test_pattern.svg +└── landing_page.html +``` + +and, to use your custom stylesheet named `+myTheme.css+`, you can use: + +``` +ASCIIsite.py --stylesheet myTheme.css -o output test +``` + +``` +output +├── css +│   └── myTheme.css +├── dir +│   └── subdir +│   └── linked.html ├── include -│   └── include.html +│   └── include.txt +├── images +│   └── test_pattern.svg └── landing_page.html ``` Alternatively, you can run + ``` -ASCIISite.py -z -o result test +ASCIISite.py -z -o output test ``` -to get a .tar.gz file containing the result directory. +to get a .tar.gz file containing the output directory. diff --git a/tests/result/dir/subdir/linked.html b/tests/control/css/asciidoctor.css similarity index 92% rename from tests/result/dir/subdir/linked.html rename to tests/control/css/asciidoctor.css index 31be3d8..98f27c4 100644 --- a/tests/result/dir/subdir/linked.html +++ b/tests/control/css/asciidoctor.css @@ -1,14 +1,3 @@ - - - - - - - - -relatively linked doc - - - - - -
-
-
-Stand By -
-
Figure 1. Technical Difficulties
-
-
-

https://git.venberg.xyz/Gabe/adocStaticSiteGen

-
-
-
A mechanical marvel
-
- -
-
-
-

back to where you came!

-
-
- - - \ No newline at end of file +@media amzn-kf8{#header,#content,#footnotes,#footer{padding:0}} \ No newline at end of file diff --git a/tests/result/dir/collatz.py b/tests/control/dir/collatz.py similarity index 100% rename from tests/result/dir/collatz.py rename to tests/control/dir/collatz.py diff --git a/tests/control/dir/subdir/linked.html b/tests/control/dir/subdir/linked.html new file mode 100644 index 0000000..b15754c --- /dev/null +++ b/tests/control/dir/subdir/linked.html @@ -0,0 +1,68 @@ + + + + + + + + +relatively linked doc + + + + + +
+
+
+Stand By +
+
Figure 1. Technical Difficulties
+
+
+
+While the creative works from the 16th century can still be accessed and used by others, the data in some software programs from the 1990s is already inaccessible. Once a company that produces a certain product goes out of business, it has no simple way to uncover how its product encoded data. The code is thus lost, and the software is inaccessible. Knowledge has been destroyed. +
+
+— Lawrence Lessig
+May the Source Be With You +
+
+
+
Three Rings for the Elven-kings under the sky,
+Seven for the dwarf-lords in their halls of stone,
+Nine for Mortal Men doomed to die,
+One for the Dark Lord on his dark throne,
+In the Land of Mordor where the Shadows lie.
+One Ring to rule them all, One Ring to find them,
+One Ring to bring them all and in the darkness bind them
+In the Land of Mordor where the Shadows lie.
+
+— J.R.R. Tolkien
+The Fellowship of the Ring +
+
+
+

https://git.venberg.xyz/Gabe/adocStaticSiteGen

+
+
+
A mechanical marvel
+
+ +
+
+
+

back to where you came!

+
+
+ + + \ No newline at end of file diff --git a/tests/result/images/test_pattern.svg b/tests/control/images/test_pattern.svg similarity index 100% rename from tests/result/images/test_pattern.svg rename to tests/control/images/test_pattern.svg diff --git a/tests/control/landing_page.html b/tests/control/landing_page.html new file mode 100644 index 0000000..99396e2 --- /dev/null +++ b/tests/control/landing_page.html @@ -0,0 +1,507 @@ + + + + + + + + +test page for an adoc static site generator. + + + + + + +
+
+
+
+ + + + + +
+ + +Test the links in this page! +
+
+
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. +Phasellus mi tellus, suscipit in dolor nec, faucibus aliquam nulla. +Mauris gravida, felis commodo molestie tincidunt, sem erat varius lorem, nec lobortis eros sem ut augue. +Donec suscipit tristique imperdiet. +Sed maximus est ultrices urna imperdiet, vitae facilisis eros posuere. +Quisque a mollis mauris. +Pellentesque fermentum, libero sed sollicitudin interdum, dolor nunc euismod purus, et laoreet tellus augue vitae turpis. +Pellentesque condimentum elit quis semper tincidunt. +Nullam consectetur euismod accumsan. +In dictum nibh ut iaculis euismod. +Phasellus ut nibh non ipsum volutpat cursus. +Sed eleifend, enim vitae ultrices auctor, dolor ipsum molestie dui, id dignissim massa neque a mauris.

+
+
+
+
+

inline formatting tests

+
+
+

bold test

+
+
+

italics test

+
+
+

'monospace test'

+
+
+

'monospace bold test'

+
+
+

'monospace italic test'

+
+
+

*italic bold test*

+
+
+

'all three test'

+
+
+

*escaped bold test*

+
+
+

underline test using html passthrough test

+
+
+

*escaped bold test with plus*

+
+
+

→ ⇒ ← ⇐

+
+
+

==colapsable block

+
+
+Details +
+
+

== list tests

+
+
+
unordered list test
+
    +
  • +

    Lorum

    +
  • +
  • +

    ipsum

    +
    +
      +
    • +

      dolor

      +
    • +
    • +

      sit

      +
      +
        +
      • +

        amet

        +
      • +
      +
      +
    • +
    • +

      consectetur

      +
    • +
    +
    +
  • +
+
+
+
ordered list test.
+
    +
  1. +

    Lorum

    +
  2. +
  3. +

    ipsum

    +
    +
      +
    1. +

      dolor

      +
    2. +
    3. +

      sit

      +
      +
        +
      1. +

        amet

        +
      2. +
      +
      +
    4. +
    5. +

      consectetur

      +
    6. +
    +
    +
  4. +
+
+
+
reversed ordered list test.
+
    +
  1. +

    Lorum

    +
  2. +
  3. +

    ipsum

    +
    +
      +
    1. +

      dolor

      +
    2. +
    3. +

      sit

      +
      +
        +
      1. +

        amet

        +
      2. +
      +
      +
    4. +
    5. +

      consectetur

      +
    6. +
    +
    +
  4. +
+
+
+
mixed list
+
    +
  1. +

    Lorum

    +
  2. +
  3. +

    ipsum

    +
    +
      +
    • +

      dolor

      +
    • +
    • +

      sit

      +
      +
        +
      • +

        amet

        +
      • +
      +
      +
    • +
    +
    +
  4. +
  5. +

    consectetur

    +
    +
      +
    • +

      adipiscing

      +
    • +
    • +

      elit

      +
    • +
    +
    +
  6. +
+
+
+
+
+
math test
+

\(\frac{\frac{1}{x}+\frac{1}{y}}{y-z}\)

+
+
+
+\$[[a,b\],[c,d\]\]((n),(k))\$ +
+
+
+
description list test
+ + + + + + + + + + + + + +
+test + +

to make sure software works correctly

+
+git + +

a gift from the machine spirits

+
+printers + +

the greatest evil to ever befall IT.

+
+
+
+
+
+ +
+
+

Lets go back to the [list tests] or to the tables

+
+ +
+
+Stand By +
+
Figure 1. Technical Difficulties
+
+
+

link!

+
+
+

xref!

+
+
+
Source code test
+
+
def nextInSequence(number):
+    if isinstance(number, int):
+        if number % 2 == 0:
+            return number // 2
+        else:
+            return 3*number+1
+    else:
+        raise TypeError('input must be int!')
+
+def seqenceLength(number):
+    length = 0
+    while number != 1:
+        number = nextInSequence(number)
+        length += 1
+    return length
+
+
+
+
+
+

tables test

+
+ +++++ + + + + + + + + + + + + + + + + + + + +
NameGroupDescription

Firefox

Web Browser

+

Mozilla Firefox is an open-source web browser. +It’s designed for:

+
+
+
    +
  • +

    standards compliance,

    +
  • +
  • +

    performance and

    +
  • +
  • +

    portability.

    +
  • +
+

Ruby

Programming Language

A programmer’s best friend.

+
+
+
+

included section

+
+
+

Fusce maximus nec magna eu ultricies. +Fusce quis tellus vitae arcu facilisis lobortis. +Donec id erat at enim porta placerat in vitae sapien. +Duis justo arcu, hendrerit nec nulla eu, dictum dapibus ipsum. +Sed fermentum id elit eget fringilla. +Suspendisse volutpat imperdiet justo, ut efficitur odio maximus et. +Nunc interdum sollicitudin eros sit amet convallis. +Praesent volutpat tempus metus id tincidunt. +Proin aliquet justo a fermentum consectetur. +Nunc scelerisque, nisi id scelerisque dictum, nibh lectus ultrices nunc, quis ultricies erat velit sit amet urna. +Maecenas orci felis, volutpat at bibendum ut, mattis eu justo.

+
+
+

blocks

+
+
listing block
+
+
example of _listing block_
+with verbatim line break
+
+
+
+
Example 1. example block
+
+
+

example block +with line break

+
+
+
+
+
literal block
+
+
_literal_ block
+with line break
+
+
+pass block +with underlined text +
+
quote block
+
+
+

quote block +with line break

+
+
+
+
+
+
sidebar block
+
+

sidebar block +with line break

+
+
+
+
+ + + + + +
+ + +
+

This is an example of an admonition block.

+
+
+

Unlike an admonition paragraph, it may contain any AsciiDoc content. +The style can be any one of the admonition labels:

+
+
+
    +
  • +

    NOTE

    +
  • +
  • +

    TIP

    +
  • +
  • +

    WARNING

    +
  • +
  • +

    CAUTION

    +
  • +
  • +

    IMPORTANT

    +
  • +
+
+
+
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/tests/control_css/css/test.css b/tests/control_css/css/test.css new file mode 100644 index 0000000..d071809 --- /dev/null +++ b/tests/control_css/css/test.css @@ -0,0 +1,239 @@ +/*template asciidoctor skin from https://github.com/darshandsoni/asciidoctor-skins/blob/gh-pages/css/template.css*/ +/* + * The MIT License (MIT) + * + * Copyright (c) 2016 Darshan Soni + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +/* document body (contains all content) */ +body { + font-size: small; +} + +/* document header (contains title etc) */ +#header { + width: 100%; +} + +/* headings */ +h1 { + color: purple; +} +h2 { + color: chartreuse; +} +h3 { + color: coral; +} +h4 { + color: darkcyan; +} +h5 { + color: darkslategray; +} +h6 { + color: olive; +} + +/* Table of Contents sidebar */ +#toc { + background-color: plum!important; + color: white; + font-weight: bold; +} +/* title of the TOC */ +#toctitle { + color: white; +} +/* top-level entries in TOC */ +.sectlevel1 { + background-color: palegoldenrod; +} +/* second-level entries in TOC */ +.sectlevel2 { + background-color: palegreen; +} + +/* main content window */ +#content { + background-color: lavender; + color: navy; +} + +/* plain paragraph text */ +.paragraph { + font-family: sans-serif; +} +p { + font-family: sans-serif; +} + +/* blockquote text */ +.quoteblock { + font-style: italic; +} +blockquote { + font-style: italic; +} + +/* the quotation mark itself (before the block) */ +.quoteblock blockquote::before { + color: blue; +} + +/* blockquote attribution text */ +.attribution { + font-size: x-large; +} + +/* blockquote citation (work where quote cited) */ +cite { + font-size: x-large; +} + +/* ordered list */ +ol { + color: red; +} +.olist { + color: red; +} + +/* unordered list */ +ul { + color: blue; +} +.ulist { + color: blue; +} + +/* links */ +a { + text-decoration: none; +} + +/* bold text */ +strong { + color: green; +} + +/* italic text */ +em { + color: orange; +} + +/* underlined text */ +u { + color: yellow; +} + +/* deleted text */ +del { + text-decoration: line-through; + color: red; +} +/* inserted text */ +ins { + text-decoration: overline; + color: green; +} + +/* strikethrough text */ +s { + text-decoration-color: red; +} + +/* superscript text */ +sup {} +/* subscript text */ +sub {} + +/* small text */ +small {} + +/* highlighted text */ +mark {} + +/* horizontal rules */ +hr {} + +/* table */ +table {} +/* table caption */ +caption {} +/* table header row */ +thead {} +/* table header cell */ +th {} +/* table row */ +tr {} +/* table footer */ +tfoot {} +/* table cell */ +td {} +/* table body */ +tbody {} + +/* inline code */ +code { + background-color: papayawhip!important; +} +/* pre-formatted text */ +pre { + background-color: burlywood!important; +} +.literalblock { + background-color: burlywood!important; +} + +/* image */ +img { + max-width: 100%; +} +/* image caption */ +.imageblock .title { + font-weight: bold!important; +} + +/* audio */ +audio {} +/* video */ +video {} + +/* footer section */ +#footer { + background-color: gray; + color: red; +} +/* footer text (by default contains time of last document update) */ +#footer-text { + font-weight: bold; + color: white; +} + +/* Responsiveness fixes */ +video { + max-width: 100%; +} + +@media all and (max-width: 600px) { +table { + width: 55vw!important; + font-size: 3vw; +} diff --git a/tests/control_css/dir/collatz.py b/tests/control_css/dir/collatz.py new file mode 100755 index 0000000..073528a --- /dev/null +++ b/tests/control_css/dir/collatz.py @@ -0,0 +1,16 @@ + +def nextInSequence(number): + if isinstance(number, int): + if number % 2 == 0: + return number // 2 + else: + return 3*number+1 + else: + raise TypeError('input must be int!') + +def seqenceLength(number): + length = 0 + while number != 1: + number = nextInSequence(number) + length += 1 + return length diff --git a/tests/control_css/dir/subdir/linked.html b/tests/control_css/dir/subdir/linked.html new file mode 100644 index 0000000..5a1cf56 --- /dev/null +++ b/tests/control_css/dir/subdir/linked.html @@ -0,0 +1,67 @@ + + + + + + + + +relatively linked doc + + + + +
+
+
+Stand By +
+
Figure 1. Technical Difficulties
+
+
+
+While the creative works from the 16th century can still be accessed and used by others, the data in some software programs from the 1990s is already inaccessible. Once a company that produces a certain product goes out of business, it has no simple way to uncover how its product encoded data. The code is thus lost, and the software is inaccessible. Knowledge has been destroyed. +
+
+— Lawrence Lessig
+May the Source Be With You +
+
+
+
Three Rings for the Elven-kings under the sky,
+Seven for the dwarf-lords in their halls of stone,
+Nine for Mortal Men doomed to die,
+One for the Dark Lord on his dark throne,
+In the Land of Mordor where the Shadows lie.
+One Ring to rule them all, One Ring to find them,
+One Ring to bring them all and in the darkness bind them
+In the Land of Mordor where the Shadows lie.
+
+— J.R.R. Tolkien
+The Fellowship of the Ring +
+
+
+

https://git.venberg.xyz/Gabe/adocStaticSiteGen

+
+
+
A mechanical marvel
+
+ +
+
+
+

back to where you came!

+
+
+ + + \ No newline at end of file diff --git a/tests/control_css/images/test_pattern.svg b/tests/control_css/images/test_pattern.svg new file mode 100644 index 0000000..7e86992 --- /dev/null +++ b/tests/control_css/images/test_pattern.svg @@ -0,0 +1,2495 @@ + + + + + + + + image/svg+xml + + Carta de Ajuste + 11/JUN/08 + + + EBNZ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/control_css/landing_page.html b/tests/control_css/landing_page.html new file mode 100644 index 0000000..8daa5fd --- /dev/null +++ b/tests/control_css/landing_page.html @@ -0,0 +1,506 @@ + + + + + + + + +test page for an adoc static site generator. + + + + + +
+
+
+
+ + + + + +
+ + +Test the links in this page! +
+
+
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. +Phasellus mi tellus, suscipit in dolor nec, faucibus aliquam nulla. +Mauris gravida, felis commodo molestie tincidunt, sem erat varius lorem, nec lobortis eros sem ut augue. +Donec suscipit tristique imperdiet. +Sed maximus est ultrices urna imperdiet, vitae facilisis eros posuere. +Quisque a mollis mauris. +Pellentesque fermentum, libero sed sollicitudin interdum, dolor nunc euismod purus, et laoreet tellus augue vitae turpis. +Pellentesque condimentum elit quis semper tincidunt. +Nullam consectetur euismod accumsan. +In dictum nibh ut iaculis euismod. +Phasellus ut nibh non ipsum volutpat cursus. +Sed eleifend, enim vitae ultrices auctor, dolor ipsum molestie dui, id dignissim massa neque a mauris.

+
+
+
+
+

inline formatting tests

+
+
+

bold test

+
+
+

italics test

+
+
+

'monospace test'

+
+
+

'monospace bold test'

+
+
+

'monospace italic test'

+
+
+

*italic bold test*

+
+
+

'all three test'

+
+
+

*escaped bold test*

+
+
+

underline test using html passthrough test

+
+
+

*escaped bold test with plus*

+
+
+

→ ⇒ ← ⇐

+
+
+

==colapsable block

+
+
+Details +
+
+

== list tests

+
+
+
unordered list test
+
    +
  • +

    Lorum

    +
  • +
  • +

    ipsum

    +
    +
      +
    • +

      dolor

      +
    • +
    • +

      sit

      +
      +
        +
      • +

        amet

        +
      • +
      +
      +
    • +
    • +

      consectetur

      +
    • +
    +
    +
  • +
+
+
+
ordered list test.
+
    +
  1. +

    Lorum

    +
  2. +
  3. +

    ipsum

    +
    +
      +
    1. +

      dolor

      +
    2. +
    3. +

      sit

      +
      +
        +
      1. +

        amet

        +
      2. +
      +
      +
    4. +
    5. +

      consectetur

      +
    6. +
    +
    +
  4. +
+
+
+
reversed ordered list test.
+
    +
  1. +

    Lorum

    +
  2. +
  3. +

    ipsum

    +
    +
      +
    1. +

      dolor

      +
    2. +
    3. +

      sit

      +
      +
        +
      1. +

        amet

        +
      2. +
      +
      +
    4. +
    5. +

      consectetur

      +
    6. +
    +
    +
  4. +
+
+
+
mixed list
+
    +
  1. +

    Lorum

    +
  2. +
  3. +

    ipsum

    +
    +
      +
    • +

      dolor

      +
    • +
    • +

      sit

      +
      +
        +
      • +

        amet

        +
      • +
      +
      +
    • +
    +
    +
  4. +
  5. +

    consectetur

    +
    +
      +
    • +

      adipiscing

      +
    • +
    • +

      elit

      +
    • +
    +
    +
  6. +
+
+
+
+
+
math test
+

\(\frac{\frac{1}{x}+\frac{1}{y}}{y-z}\)

+
+
+
+\$[[a,b\],[c,d\]\]((n),(k))\$ +
+
+
+
description list test
+ + + + + + + + + + + + + +
+test + +

to make sure software works correctly

+
+git + +

a gift from the machine spirits

+
+printers + +

the greatest evil to ever befall IT.

+
+
+
+
+
+ +
+
+

Lets go back to the [list tests] or to the tables

+
+ +
+
+Stand By +
+
Figure 1. Technical Difficulties
+
+
+

link!

+
+
+

xref!

+
+
+
Source code test
+
+
def nextInSequence(number):
+    if isinstance(number, int):
+        if number % 2 == 0:
+            return number // 2
+        else:
+            return 3*number+1
+    else:
+        raise TypeError('input must be int!')
+
+def seqenceLength(number):
+    length = 0
+    while number != 1:
+        number = nextInSequence(number)
+        length += 1
+    return length
+
+
+
+
+
+

tables test

+
+ +++++ + + + + + + + + + + + + + + + + + + + +
NameGroupDescription

Firefox

Web Browser

+

Mozilla Firefox is an open-source web browser. +It’s designed for:

+
+
+
    +
  • +

    standards compliance,

    +
  • +
  • +

    performance and

    +
  • +
  • +

    portability.

    +
  • +
+

Ruby

Programming Language

A programmer’s best friend.

+
+
+
+

included section

+
+
+

Fusce maximus nec magna eu ultricies. +Fusce quis tellus vitae arcu facilisis lobortis. +Donec id erat at enim porta placerat in vitae sapien. +Duis justo arcu, hendrerit nec nulla eu, dictum dapibus ipsum. +Sed fermentum id elit eget fringilla. +Suspendisse volutpat imperdiet justo, ut efficitur odio maximus et. +Nunc interdum sollicitudin eros sit amet convallis. +Praesent volutpat tempus metus id tincidunt. +Proin aliquet justo a fermentum consectetur. +Nunc scelerisque, nisi id scelerisque dictum, nibh lectus ultrices nunc, quis ultricies erat velit sit amet urna. +Maecenas orci felis, volutpat at bibendum ut, mattis eu justo.

+
+
+

blocks

+
+
listing block
+
+
example of _listing block_
+with verbatim line break
+
+
+
+
Example 1. example block
+
+
+

example block +with line break

+
+
+
+
+
literal block
+
+
_literal_ block
+with line break
+
+
+pass block +with underlined text +
+
quote block
+
+
+

quote block +with line break

+
+
+
+
+
+
sidebar block
+
+

sidebar block +with line break

+
+
+
+
+ + + + + +
+ + +
+

This is an example of an admonition block.

+
+
+

Unlike an admonition paragraph, it may contain any AsciiDoc content. +The style can be any one of the admonition labels:

+
+
+
    +
  • +

    NOTE

    +
  • +
  • +

    TIP

    +
  • +
  • +

    WARNING

    +
  • +
  • +

    CAUTION

    +
  • +
  • +

    IMPORTANT

    +
  • +
+
+
+
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/tests/globignore b/tests/globignore new file mode 100644 index 0000000..0eddfc6 --- /dev/null +++ b/tests/globignore @@ -0,0 +1 @@ +include* diff --git a/tests/result/include/include.html b/tests/result/include/include.html deleted file mode 100644 index 74d8e07..0000000 --- a/tests/result/include/include.html +++ /dev/null @@ -1,552 +0,0 @@ - - - - - - - -included section - - - - - -
-
-

included section

-
-
-

Fusce maximus nec magna eu ultricies. -Fusce quis tellus vitae arcu facilisis lobortis. -Donec id erat at enim porta placerat in vitae sapien. -Duis justo arcu, hendrerit nec nulla eu, dictum dapibus ipsum. -Sed fermentum id elit eget fringilla. -Suspendisse volutpat imperdiet justo, ut efficitur odio maximus et. -Nunc interdum sollicitudin eros sit amet convallis. -Praesent volutpat tempus metus id tincidunt. -Proin aliquet justo a fermentum consectetur. -Nunc scelerisque, nisi id scelerisque dictum, nibh lectus ultrices nunc, quis ultricies erat velit sit amet urna. -Maecenas orci felis, volutpat at bibendum ut, mattis eu justo.

-
-
-

blocks

-
-
listing block
-
-
example of _listing block_
-with verbatim line break
-
-
-
-
Example 1. example block
-
-
-

example block -with line break

-
-
-
-
-
literal block
-
-
_literal_ block
-with line break
-
-
-pass block -with underlined text -
-
quote block
-
-
-

quote block -with line break

-
-
-
-
-
-
sidebar block
-
-

sidebar block -with line break

-
-
-
-
- - - - - -
-
Note
-
-
-

This is an example of an admonition block.

-
-
-

Unlike an admonition paragraph, it may contain any AsciiDoc content. -The style can be any one of the admonition labels:

-
-
-
    -
  • -

    NOTE

    -
  • -
  • -

    TIP

    -
  • -
  • -

    WARNING

    -
  • -
  • -

    CAUTION

    -
  • -
  • -

    IMPORTANT

    -
  • -
-
-
-
-
-
-
-
- - - \ No newline at end of file diff --git a/tests/result/landing_page.html b/tests/result/landing_page.html deleted file mode 100644 index cf05dcc..0000000 --- a/tests/result/landing_page.html +++ /dev/null @@ -1,897 +0,0 @@ - - - - - - - - -test page for an adoc static site generator. - - - - - - -
-
-
-
- - - - - -
- - -Test the links in this page! -
-
-
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit. -Phasellus mi tellus, suscipit in dolor nec, faucibus aliquam nulla. -Mauris gravida, felis commodo molestie tincidunt, sem erat varius lorem, nec lobortis eros sem ut augue. -Donec suscipit tristique imperdiet. -Sed maximus est ultrices urna imperdiet, vitae facilisis eros posuere. -Quisque a mollis mauris. -Pellentesque fermentum, libero sed sollicitudin interdum, dolor nunc euismod purus, et laoreet tellus augue vitae turpis. -Pellentesque condimentum elit quis semper tincidunt. -Nullam consectetur euismod accumsan. -In dictum nibh ut iaculis euismod. -Phasellus ut nibh non ipsum volutpat cursus. -Sed eleifend, enim vitae ultrices auctor, dolor ipsum molestie dui, id dignissim massa neque a mauris.

-
-
-
-
-

inline formatting tests

-
-
-

bold test

-
-
-

italics test

-
-
-

'monospace test'

-
-
-

'monospace bold test'

-
-
-

'monospace italic test'

-
-
-

*italic bold test*

-
-
-

'all three test'

-
-
-

*escaped bold test*

-
-
-

underline test using html passthrough test

-
-
-

*escaped bold test with plus*

-
-
-

→ ⇒ ← ⇐

-
-
-
-
-

list tests

-
-
-
unordered list test
-
    -
  • -

    Lorum

    -
  • -
  • -

    ipsum

    -
    -
      -
    • -

      dolor

      -
    • -
    • -

      sit

      -
      -
        -
      • -

        amet

        -
      • -
      -
      -
    • -
    • -

      consectetur

      -
    • -
    -
    -
  • -
-
-
-
ordered list test.
-
    -
  1. -

    Lorum

    -
  2. -
  3. -

    ipsum

    -
    -
      -
    1. -

      dolor

      -
    2. -
    3. -

      sit

      -
      -
        -
      1. -

        amet

        -
      2. -
      -
      -
    4. -
    5. -

      consectetur

      -
    6. -
    -
    -
  4. -
-
-
-
reversed ordered list test.
-
    -
  1. -

    Lorum

    -
  2. -
  3. -

    ipsum

    -
    -
      -
    1. -

      dolor

      -
    2. -
    3. -

      sit

      -
      -
        -
      1. -

        amet

        -
      2. -
      -
      -
    4. -
    5. -

      consectetur

      -
    6. -
    -
    -
  4. -
-
-
-
mixed list
-
    -
  1. -

    Lorum

    -
  2. -
  3. -

    ipsum

    -
    -
      -
    • -

      dolor

      -
    • -
    • -

      sit

      -
      -
        -
      • -

        amet

        -
      • -
      -
      -
    • -
    -
    -
  4. -
  5. -

    consectetur

    -
    -
      -
    • -

      adipiscing

      -
    • -
    • -

      elit

      -
    • -
    -
    -
  6. -
-
-
-
description list test
- - - - - - - - - - - - - -
-test - -

to make sure software works correctly

-
-git - -

a gift from the machine spirits

-
-printers - -

the greatest evil to ever befall IT.

-
-
-
-
-
- -
-
-

Lets go back to the list tests or to the tables

-
- -
-
-Stand By -
-
Figure 1. Technical Difficulties
-
-
-

link!

-
-
-

xref!

-
-
-
Source code test
-
-
def nextInSequence(number):
-    if isinstance(number, int):
-        if number % 2 == 0:
-            return number // 2
-        else:
-            return 3*number+1
-    else:
-        raise TypeError('input must be int!')
-
-def seqenceLength(number):
-    length = 0
-    while number != 1:
-        number = nextInSequence(number)
-        length += 1
-    return length
-
-
-
-
-
-

tables test

-
- ----- - - - - - - - - - - - - - - - - - - - -
NameGroupDescription

Firefox

Web Browser

-

Mozilla Firefox is an open-source web browser. -It’s designed for:

-
-
-
    -
  • -

    standards compliance,

    -
  • -
  • -

    performance and

    -
  • -
  • -

    portability.

    -
  • -
-

Ruby

Programming Language

A programmer’s best friend.

-
-
-
-

included section

-
-
-

Fusce maximus nec magna eu ultricies. -Fusce quis tellus vitae arcu facilisis lobortis. -Donec id erat at enim porta placerat in vitae sapien. -Duis justo arcu, hendrerit nec nulla eu, dictum dapibus ipsum. -Sed fermentum id elit eget fringilla. -Suspendisse volutpat imperdiet justo, ut efficitur odio maximus et. -Nunc interdum sollicitudin eros sit amet convallis. -Praesent volutpat tempus metus id tincidunt. -Proin aliquet justo a fermentum consectetur. -Nunc scelerisque, nisi id scelerisque dictum, nibh lectus ultrices nunc, quis ultricies erat velit sit amet urna. -Maecenas orci felis, volutpat at bibendum ut, mattis eu justo.

-
-
-

blocks

-
-
listing block
-
-
example of _listing block_
-with verbatim line break
-
-
-
-
Example 1. example block
-
-
-

example block -with line break

-
-
-
-
-
literal block
-
-
_literal_ block
-with line break
-
-
-pass block -with underlined text -
-
quote block
-
-
-

quote block -with line break

-
-
-
-
-
-
sidebar block
-
-

sidebar block -with line break

-
-
-
-
- - - - - -
- - -
-

This is an example of an admonition block.

-
-
-

Unlike an admonition paragraph, it may contain any AsciiDoc content. -The style can be any one of the admonition labels:

-
-
-
    -
  • -

    NOTE

    -
  • -
  • -

    TIP

    -
  • -
  • -

    WARNING

    -
  • -
  • -

    CAUTION

    -
  • -
  • -

    IMPORTANT

    -
  • -
-
-
-
-
-
-
-
- - - \ No newline at end of file diff --git a/tests/test.css b/tests/test.css new file mode 100644 index 0000000..d071809 --- /dev/null +++ b/tests/test.css @@ -0,0 +1,239 @@ +/*template asciidoctor skin from https://github.com/darshandsoni/asciidoctor-skins/blob/gh-pages/css/template.css*/ +/* + * The MIT License (MIT) + * + * Copyright (c) 2016 Darshan Soni + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +/* document body (contains all content) */ +body { + font-size: small; +} + +/* document header (contains title etc) */ +#header { + width: 100%; +} + +/* headings */ +h1 { + color: purple; +} +h2 { + color: chartreuse; +} +h3 { + color: coral; +} +h4 { + color: darkcyan; +} +h5 { + color: darkslategray; +} +h6 { + color: olive; +} + +/* Table of Contents sidebar */ +#toc { + background-color: plum!important; + color: white; + font-weight: bold; +} +/* title of the TOC */ +#toctitle { + color: white; +} +/* top-level entries in TOC */ +.sectlevel1 { + background-color: palegoldenrod; +} +/* second-level entries in TOC */ +.sectlevel2 { + background-color: palegreen; +} + +/* main content window */ +#content { + background-color: lavender; + color: navy; +} + +/* plain paragraph text */ +.paragraph { + font-family: sans-serif; +} +p { + font-family: sans-serif; +} + +/* blockquote text */ +.quoteblock { + font-style: italic; +} +blockquote { + font-style: italic; +} + +/* the quotation mark itself (before the block) */ +.quoteblock blockquote::before { + color: blue; +} + +/* blockquote attribution text */ +.attribution { + font-size: x-large; +} + +/* blockquote citation (work where quote cited) */ +cite { + font-size: x-large; +} + +/* ordered list */ +ol { + color: red; +} +.olist { + color: red; +} + +/* unordered list */ +ul { + color: blue; +} +.ulist { + color: blue; +} + +/* links */ +a { + text-decoration: none; +} + +/* bold text */ +strong { + color: green; +} + +/* italic text */ +em { + color: orange; +} + +/* underlined text */ +u { + color: yellow; +} + +/* deleted text */ +del { + text-decoration: line-through; + color: red; +} +/* inserted text */ +ins { + text-decoration: overline; + color: green; +} + +/* strikethrough text */ +s { + text-decoration-color: red; +} + +/* superscript text */ +sup {} +/* subscript text */ +sub {} + +/* small text */ +small {} + +/* highlighted text */ +mark {} + +/* horizontal rules */ +hr {} + +/* table */ +table {} +/* table caption */ +caption {} +/* table header row */ +thead {} +/* table header cell */ +th {} +/* table row */ +tr {} +/* table footer */ +tfoot {} +/* table cell */ +td {} +/* table body */ +tbody {} + +/* inline code */ +code { + background-color: papayawhip!important; +} +/* pre-formatted text */ +pre { + background-color: burlywood!important; +} +.literalblock { + background-color: burlywood!important; +} + +/* image */ +img { + max-width: 100%; +} +/* image caption */ +.imageblock .title { + font-weight: bold!important; +} + +/* audio */ +audio {} +/* video */ +video {} + +/* footer section */ +#footer { + background-color: gray; + color: red; +} +/* footer text (by default contains time of last document update) */ +#footer-text { + font-weight: bold; + color: white; +} + +/* Responsiveness fixes */ +video { + max-width: 100%; +} + +@media all and (max-width: 600px) { +table { + width: 55vw!important; + font-size: 3vw; +} diff --git a/tests/test.sh b/tests/test.sh new file mode 100644 index 0000000..24a6905 --- /dev/null +++ b/tests/test.sh @@ -0,0 +1,31 @@ +rm -r result +../ASCIIsite.py --verbose --output result --exclude-file globignore test +#find the sha1sum of the output +cd result +result=$(find . -type f -print0 | xargs -0 -P0 -n1 md5sum | sort -k 2 | md5sum) +cd ../control +control=$(find . -type f -print0 | xargs -0 -P0 -n1 md5sum | sort -k 2 | md5sum) +cd ../ +tree result +echo result sum is $result +echo control sum is $control +if [ "$result" = "$control" ]; then + echo test passed! +else + echo test did not pass!!!!! +fi +rm -r result_css +../ASCIIsite.py --verbose --output result_css --exclude-file globignore --stylesheet test.css test +cd result_css +result_css=$(find . -type f -print0 | xargs -0 -P0 -n1 md5sum | sort -k 2 | md5sum) +cd ../control_css +control_css=$(find . -type f -print0 | xargs -0 -P0 -n1 md5sum | sort -k 2 | md5sum) +cd ../ +tree result_css +echo result_css sum is $result_css +echo control_css sum is $control_css +if [ "$result_css" = "$control_css" ]; then + echo test passed! +else + echo test did not pass!!!!! +fi diff --git a/tests/test/dir/subdir/linked.adoc b/tests/test/dir/subdir/linked.adoc index 4225eb8..1612be6 100644 --- a/tests/test/dir/subdir/linked.adoc +++ b/tests/test/dir/subdir/linked.adoc @@ -1,13 +1,25 @@ = relatively linked doc Gabe Venberg -:imagesdir: ../../images/ :reproducible: :giturl: git.venberg.xyz/Gabe/adocStaticSiteGen [#test-pattern] .Technical Difficulties [link={giturl}] -image::test_patern.jpg[Stand By] +image::test_pattern.svg[Stand By] + +[quote, Lawrence Lessig, May the Source Be With You] +While the creative works from the 16th century can still be accessed and used by others, the data in some software programs from the 1990s is already inaccessible. Once a company that produces a certain product goes out of business, it has no simple way to uncover how its product encoded data. The code is thus lost, and the software is inaccessible. Knowledge has been destroyed. + +[verse, J.R.R. Tolkien, The Fellowship of the Ring] +Three Rings for the Elven-kings under the sky, +Seven for the dwarf-lords in their halls of stone, +Nine for Mortal Men doomed to die, +One for the Dark Lord on his dark throne, +In the Land of Mordor where the Shadows lie. +One Ring to rule them all, One Ring to find them, +One Ring to bring them all and in the darkness bind them +In the Land of Mordor where the Shadows lie. https://git.venberg.xyz/Gabe/adocStaticSiteGen diff --git a/tests/test/include/include.adoc b/tests/test/include/include.txt similarity index 100% rename from tests/test/include/include.adoc rename to tests/test/include/include.txt diff --git a/tests/test/landing_page.adoc b/tests/test/landing_page.adoc index 0a4b2f5..6a9e1f3 100644 --- a/tests/test/landing_page.adoc +++ b/tests/test/landing_page.adoc @@ -1,11 +1,11 @@ = test page for an adoc static site generator. Gabe Venberg -:imagesdir: images :docdate: 2021-08-06 :reproducible: :giturl: https://git.venberg.xyz/Gabe/adocStaticSiteGen :toc: :icons: font +:stem: latexmath :includedir: include/ @@ -48,6 +48,9 @@ _*italic bold test*_ -> => <- <= +==colapsable block +[%collapsible] +==== == list tests .unordered list test @@ -85,6 +88,15 @@ _*italic bold test*_ ** adipiscing ** elit +==== + +.math test +stem:[\frac{\frac{1}{x}+\frac{1}{y}}{y-z}] +[asciimath] +++++ +[[a,b\],[c,d\]\]((n),(k)) +++++ + .description list test [horizontal] test:: to make sure software works correctly @@ -131,4 +143,4 @@ It's designed for: |=== -include::{includedir}/include.adoc[] +include::{includedir}/include.txt[]