Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Alexis Brenon
arcades
Commits
d285cf21
Commit
d285cf21
authored
Jan 31, 2018
by
Alexis Brenon
Browse files
✨
Handle note/warn tags
parent
3b2a5567
Changes
3
Hide whitespace changes
Inline
Side-by-side
assets/ldoc/ldoc.css
View file @
d285cf21
...
...
@@ -39,3 +39,7 @@ ul.parameters a.type:before, ul.returns a.type:before {
content
:
"\F339"
;
margin-right
:
0.25em
;
}
.card.bg-primary
a
,
.card.bg-info
a
{
color
:
#fff
;
}
assets/ldoc/ldoc.ltp
View file @
d285cf21
...
...
@@ -100,6 +100,7 @@
<link
rel=
"stylesheet"
href=
"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css"
integrity=
"sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb"
crossorigin=
"anonymous"
>
<link
href=
"https://fonts.googleapis.com/icon?family=Material+Icons"
rel=
"stylesheet"
>
<link
href=
"$(html_root)/bootstrap-4-navbar.css"
rel=
"stylesheet"
>
<link
href=
"$(html_root)/ldoc.css"
rel=
"stylesheet"
>
</head>
<!-- **************************************************************** -->
...
...
@@ -437,7 +438,7 @@
<!-- Module usage-->
<div
class=
"col-xs-12 module-usage"
>
<strong>
Usage:
</strong>
<ul>
<ul
class=
"list-unstyled"
>
# for usage in iter(module.usage) do
<li>
<pre><code>
$(ldoc.escape(usage))
</code></pre>
...
...
@@ -520,14 +521,24 @@
# for custom in iter(ldoc.custom_tags) do
# local tag = item.tags[custom[1]]
# if tag and not custom.hidden then
<strong>
$(custom.title or custom[1]):
</strong>
<ul>
# local div_class = "card mb-3"
# if custom[1] == 'warn' then
# div_class = div_class .. " bg-warning"
# elseif custom[1] == 'note' then
# div_class = div_class .. " bg-info"
# end
<div
class=
"$(div_class)"
>
<div
class=
"card-body py-2"
>
<strong
class=
"card-title"
>
$(custom.title or custom[1]):
</strong>
<ul
class=
"card-text list-unstyled"
>
# for value in iter(tag) do
<li>
$(custom.format and custom.format(value) or M(value))
</li>
<li>
$(custom.format and custom.format(value) or M(value))
</li>
# end -- for
</ul>
</ul>
</div>
</div>
# end -- if tag
# end -- iter custom_tags
# end -- if ldoc.custom_tags
...
...
@@ -645,7 +656,7 @@
# if item.usage then
<strong>
Usage:
</strong>
<ul>
<ul
class=
"list-unstyled"
>
# for usage in iter(item.usage) do
<li>
<pre
class=
"example"
><code>
$(ldoc.prettify(usage))
</code></pre>
...
...
config.ld
View file @
d285cf21
...
...
@@ -17,6 +17,10 @@ style="assets/ldoc"
template="assets/ldoc"
new_type("package", "Packages", true)
custom_tags={
{"warn", title="Warning"},
{"note", title="Note"}
}
custom_display_name_handler = function(item)
return item.names_hierarchy[#item.names_hierarchy] ..
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment