Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit d285cf21 authored by Alexis Brenon's avatar Alexis Brenon
Browse files

Handle note/warn tags

parent 3b2a5567
......@@ -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;
}
......@@ -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>
......
......@@ -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] ..
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment