Skip to content
This repository has been archived by the owner on Apr 8, 2020. It is now read-only.

Commit

Permalink
Generation script for functions doc
Browse files Browse the repository at this point in the history
  • Loading branch information
giancarlopro committed Mar 21, 2018
1 parent fd2661f commit 7308f23
Show file tree
Hide file tree
Showing 10 changed files with 1,979 additions and 335 deletions.
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/functions.doctree
Binary file not shown.
317 changes: 301 additions & 16 deletions docs/_build/html/_sources/functions.rst.txt

Large diffs are not rendered by default.

783 changes: 761 additions & 22 deletions docs/_build/html/functions.html

Large diffs are not rendered by default.

859 changes: 581 additions & 278 deletions docs/_build/html/genindex.html

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions docs/_build/html/index.html
Expand Up @@ -183,8 +183,7 @@ <h1>Framebot - Documentação<a class="headerlink" href="#framebot-documentacao"
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="functions.html">Funções</a><ul>
<li class="toctree-l2"><a class="reference internal" href="functions.html#funcoes-exclusivas">Funções exclusivas</a></li>
<li class="toctree-l2"><a class="reference internal" href="functions.html#funcoes-da-api">Funções da API</a></li>
<li class="toctree-l2"><a class="reference internal" href="functions.html#referencia-completa">Referencia completa</a></li>
</ul>
</li>
</ul>
Expand Down
Binary file modified docs/_build/html/objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/html/searchindex.js

Large diffs are not rendered by default.

317 changes: 301 additions & 16 deletions docs/functions.rst

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions scripts/generate-doc-functions.py
@@ -0,0 +1,33 @@
import re

fname = re.compile(r"\w+\s\*{0,1}\s{0,1}\w+\*{0,1}\s{0,1}\(")

def clean (content):
return content.replace("\n", "").replace(" ", " ")
# return content

with open('../include/framebot/objects.h') as f:
content = f.read()

names = fname.findall(content)
dump = list()

for name in names:
tmp = content.split(name)
params = tmp[1].split(");")[0]
dump.append("{}{})".format(name, clean(params)))

with open('../include/framebot/framebot.h') as f:
content = f.read().split("#include <framebot/util.h>")[1]

names = fname.findall(content)
# dump = list()

for name in names:
tmp = content.split(name)
params = tmp[1].split(");")[0]
dump.append("{}{})".format(name, clean(params)))

with open('functions.rst', 'w') as f:
for func in dump:
f.write(".. c:function:: {}\n\n".format(func))

0 comments on commit 7308f23

Please sign in to comment.