Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
af9b5107
Commit
af9b5107
authored
Jun 16, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3220 from dsedivec/devel
Improve Markdown (and other) module doc output
parents
17cf833e
7681b1ce
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
hacking/module_formatter.py
+9
-2
hacking/templates/markdown.j2
+7
-2
No files found.
hacking/module_formatter.py
View file @
af9b5107
...
...
@@ -30,6 +30,7 @@ import optparse
import
time
import
datetime
import
subprocess
import
cgi
import
ansible.utils
import
ansible.utils.module_docs
as
module_docs
...
...
@@ -62,11 +63,13 @@ def latex_ify(text):
def
html_ify
(
text
):
t
=
_ITALIC
.
sub
(
"<em>"
+
r"\1"
+
"</em>"
,
text
)
t
=
cgi
.
escape
(
text
)
t
=
_ITALIC
.
sub
(
"<em>"
+
r"\1"
+
"</em>"
,
t
)
t
=
_BOLD
.
sub
(
"<b>"
+
r"\1"
+
"</b>"
,
t
)
t
=
_MODULE
.
sub
(
"<span class='module'>"
+
r"\1"
+
"</span>"
,
t
)
t
=
_URL
.
sub
(
"<a href='"
+
r"\1"
+
"'>"
+
r"\1"
+
"</a>"
,
t
)
t
=
_CONST
.
sub
(
"<code>"
+
r"\1"
+
"</code>"
,
t
)
return
t
def
json_ify
(
text
):
...
...
@@ -105,9 +108,13 @@ def rst_ify(text):
return
t
_MARKDOWN
=
re
.
compile
(
r"[*_`]"
)
def
markdown_ify
(
text
):
t
=
_ITALIC
.
sub
(
"_"
+
r"\1"
+
"_"
,
text
)
t
=
cgi
.
escape
(
text
)
t
=
_MARKDOWN
.
sub
(
r"\\\g<0>"
,
t
)
t
=
_ITALIC
.
sub
(
"_"
+
r"\1"
+
"_"
,
t
)
t
=
_BOLD
.
sub
(
"**"
+
r"\1"
+
"**"
,
t
)
t
=
_MODULE
.
sub
(
"*"
+
r"\1"
+
"*"
,
t
)
t
=
_URL
.
sub
(
"["
+
r"\1"
+
"]("
+
r"\1"
+
")"
,
t
)
...
...
hacking/templates/markdown.j2
View file @
af9b5107
## @{ module }@
## @{ module
| jpfunc
}@
{# ------------------------------------------
#
...
...
@@ -11,7 +11,8 @@ New in version @{ version_added }@.
{% endif %}
{% for desc in description -%}
@{ desc | jpfunc }@
@{ desc | jpfunc }@
{% endfor %}
{% if options -%}
...
...
@@ -35,6 +36,10 @@ New in version @{ version_added }@.
</table>
{% endif %}
{% if examples or plainexamples %}
#### Examples
{% endif %}
{% for example in examples %}
{% if example['description'] %}
* @{ example['description'] | jpfunc }@
...
...
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