Skip to content

Commit

Permalink
Support to generate documentation using make
Browse files Browse the repository at this point in the history
Closes #79
  • Loading branch information
ligurio committed Sep 13, 2021
1 parent 6e569b0 commit a73b751
Show file tree
Hide file tree
Showing 5 changed files with 1,293 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
# This way everything works as expected ever for
# `make -C /path/to/project` or
# `make -f /path/to/project/Makefile`.
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
PROJECT_DIR := $(patsubst %/,%,$(dir $(MAKEFILE_PATH)))
LUACOV_REPORT := $(PROJECT_DIR)/luacov.report.out

CLEANUP_FILES = tarantool.log
CLEANUP_FILES += *.xlog*
CLEANUP_FILES += *.snap
CLEANUP_FILES += 51{2,3,4,5,6,7} # Directories that vinyl creates.

all: test

# The template (ldoc.tpl) is written using tarantool specific
# functions like string.split(), string.endswith(), so we run
# ldoc using tarantool.
apidoc:
.rocks/bin/ldoc -c $(PROJECT_DIR)/doc/ldoc/config.ld \
-d $(PROJECT_DIR)/doc/apidoc/ expirationd.lua

check: luacheck

luacheck:
Expand Down
345 changes: 345 additions & 0 deletions doc/apidoc/ldoc.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,345 @@
body {
font-size: 16px;
font-family: "Open Sans", sans-serif;
margin: 0;
}

a:link { color: #fd4c4d; }
a:visited { color: #fd4c4d; }
a:hover { color: #fd4c4d; }

h1 { font-size:26px; font-weight: normal; }
h2 { font-size:22px; font-weight: normal; }
h3 { font-size:18px; font-weight: normal; }
h4 { font-size:16px; font-weight: bold; }

hr {
height: 1px;
background: #c1cce4;
border: 0px;
margin: 15px 0;
}

#content code, tt {
font-family: monospace;
box-sizing: border-box;
background-color: #f9f2f4;
color: #c7254e;
border-radius: 6px;
font-size: 85%;
padding: 1px 0.4em;
}

#content h1 > code {
background-color: #333333;
color: white;
padding: 1px 0.4em;
}

.parameter {
font-family: monospace;
font-weight: bold;
color: #c7254e;
}

.parameter-info {
color: #555555;
}

.type {
font-style: italic
}

.parameter-description {
display: inline-block;
padding-left: 15pt;
margin-bottom: 5px;
}

.parameter-description > p {
margin-top: 0.3em;
margin-bottom: 0.5em;
}

p.name {
font-family: monospace;
}

#main {
position: relative;
}

#navigation {
position: absolute;
color: white;
background-color: #262626;
border-bottom: 1px solid #d3dbec;

height: 100%;
width: 18em;
vertical-align: top;
overflow: visible;
}

#navigation a:link {
color: white;
}
#navigation a:visited {
color: white;
}
#navigation a:hover {
color: white;
}

#navigation br {
display: none;
}

#navigation h1 {
border-bottom: 1px solid #404040;
padding: 15px;
margin-top: 0px;
margin-bottom: 0px;
}

#navigation h2 {
font-size: 18px;
border-bottom: 1px solid #404040;
padding-left: 15px;
padding-right: 15px;
padding-top: 10px;
padding-bottom: 10px;
margin-top: 30px;
margin-bottom: 0px;
}

#content h1 {
background-color: black;
color: white;
padding: 15px;
margin: 0px;
}

#content > p {
padding-left: 15px;
}

#content h2 {
background-color: #f9f2f4;
padding: 15px;
padding-top: 15px;
padding-bottom: 15px;
margin-top: 0px;
}

#content h2 a {
color: #fd4c4d;
text-decoration: none;
}

#content h2 a:hover {
text-decoration: underline;
}

#content h3 {
font-style: italic;
padding-top: 15px;
padding-bottom: 4px;
margin-right: 15px;
margin-left: 15px;
margin-bottom: 5px;
border-bottom: solid 1px #bcd;
}

#content h4 {
margin-right: 15px;
margin-left: 15px;
border-bottom: solid 1px #bcd;
}

pre {
background-color: #f9f2f4;
border-radius: 6px;
border: 1px solid #cccccc;
padding: 10px;
overflow: auto;
font-family: monospace;
font-size: 85%;
}

#content ul pre.example {
margin-left: 0px;
}

table.index {
/* border: 1px #00007f; */
}
table.index td { text-align: left; vertical-align: top; }

#navigation ul
{
font-size:1em;
list-style-type: none;
margin: 1px 1px 10px 1px;
}

#navigation li {
text-indent: -1em;
display: block;
margin: 3px 0px 0px 22px;
}

#navigation li li a {
margin: 0px 3px 0px -1em;
}

#content {
margin-left: 18em;
}

#content .function dd > p {
margin-top: 0.3em;
margin-bottom: 0.5em;
}

#content table {
padding-left: 15px;
padding-right: 15px;
background-color: white;
}

#content p, #content table, #content ol, #content ul, #content dl {
max-width: 900px;
}

table.module_list, table.function_list {
border-width: 1px;
border-style: solid;
border-color: #cccccc;
border-collapse: collapse;
margin: 15px;
}
table.module_list td, table.function_list td {
border-width: 1px;
padding-left: 10px;
padding-right: 10px;
padding-top: 5px;
padding-bottom: 5px;
border: solid 1px #cccccc;
}
table.module_list td.name, table.function_list td.name {
background-color: white; min-width: 200px; border-right-width: 0px;
}
table.module_list td.summary, table.function_list td.summary {
background-color: white; width: 100%; border-left-width: 0px;
}

dl.function {
margin-right: 15px;
margin-left: 15px;
border-bottom: solid 1px #cccccc;
border-left: solid 1px #cccccc;
border-right: solid 1px #cccccc;
background-color: white;
}

dl.function dt {
color: #c7254e;
font-family: monospace;
border-top: solid 1px #cccccc;
padding: 15px 15px 0.5em 15px;
}

dl.function dd {
margin-left: 15px;
margin-right: 15px;
margin-top: 5px;
margin-bottom: 15px;
}

#content dl.function dd h3 {
margin-top: 0px;
margin-left: 0px;
padding-left: 0px;
font-size: 16px;
color: #555555;
border-bottom: solid 1px #def;
}

#content dl.function dd ul, #content dl.function dd ol {
padding: 0px;
padding-left: 15px;
list-style-type: none;
}

/* Highlight XXX notes. */
#content .xxx {
box-sizing: border-box;
background-color: yellow;
color: black;
border-radius: 6px;
border: #c7254e solid 1px;
padding: 0.1em 0.2em;
}

ul.nowrap {
overflow:auto;
white-space:nowrap;
}

.section-description {
padding-left: 15px;
padding-right: 15px;
}

/* stop sublists from having initial vertical space */
ul ul { margin-top: 0px; }
ol ul { margin-top: 0px; }
ol ol { margin-top: 0px; }
ul ol { margin-top: 0px; }

/* make the target distinct; helps when we're navigating to a function */
a:target + * {
background-color: #FF9;
}


/* styles for prettification of source */
pre .comment { color: #bbccaa; }
pre .constant { color: #a8660d; }
pre .escape { color: #844631; }
pre .keyword { color: #ffc090; font-weight: bold; }
pre .library { color: #0e7c6b; }
pre .marker { color: #512b1e; background: #fedc56; font-weight: bold; }
pre .string { color: #8080ff; }
pre .number { color: #f8660d; }
pre .operator { color: #2239a8; font-weight: bold; }
pre .preprocessor, pre .prepro { color: #a33243; }
pre .global { color: #c040c0; }
pre .user-keyword { color: #800080; }
pre .prompt { color: #558817; }
pre .url { color: #272fc2; text-decoration: underline; }

html body #content ul.markdown_list {
list-style-type: disc;
}

#content table.markdown_table {
padding: 0px;
border-collapse: collapse;
}
.markdown_table td, th {
border: 1px solid #999999;
padding: 7px;
}
.markdown_table th {
background-color: #ccc;
}

.markdown_table tr:nth-child(odd) td {
background-color: white;
}

.markdown_table tr:nth-child(even) td {
background-color: #f9f2f4;
}
Loading

0 comments on commit a73b751

Please sign in to comment.