コード例 #1
0
ファイル: mkdocs.py プロジェクト: dsbowen/docstr-md
src_href = Github('https://github.com/dsbowen/docstr-md/blob/master')

path = 'docstr_md/python/__init__.py'
soup = PySoup(path=path, parser='sklearn', src_href=src_href)
soup.rm_properties()
compile_md(soup, compiler='sklearn', outfile='docs_md/python/basic_use.md')

path = 'docstr_md/src_href/github.py'
soup = PySoup(path=path, parser='sklearn', src_href=src_href)
soup.objects.insert(0, '#Linking to source code')
compile_md(soup, compiler='sklearn', outfile='docs_md/src_href.md')

path = 'docstr_md/python/soup_objects.py'
soup = PySoup(path=path, parser='sklearn', src_href=src_href)
soup.keep_objects('Expr', 'FunctionDef', 'ClassDef')
soup.rm_properties()
soup.import_path = 'docstr_md/python'
compile_md(soup, compiler='sklearn', outfile='docs_md/python/soup_objects.md')

path = 'docstr_md/python/parsers/sklearn.py'
soup = PySoup(path=path, parser='sklearn', src_href=src_href)
soup.import_path = 'docstr_md/python/parsers'
soup.objects.insert(0, '#Parsers')
compile_md(soup, compiler='sklearn', outfile='docs_md/python/parsers.md')

path = 'docstr_md/python/compilers/sklearn.py'
soup = PySoup(path=path, parser='sklearn', src_href=src_href)
soup.import_path = 'docstr_md/python/compilers'
soup.objects.insert(0, '#Compilers')
compile_md(soup, compiler='sklearn', outfile='docs_md/python/compilers.md')
コード例 #2
0
from docstr_md.python import PySoup, compile_md
from docstr_md.src_href import Github

src_href = Github('https://github.com/dsbowen/sqlalchemy-mutable/blob/master')

path = 'sqlalchemy_mutable/mutable.py'
soup = PySoup(path=path, parser='sklearn', src_href=src_href)
soup.rm_properties()
mutable = [
    obj for obj in soup.objects
    if hasattr(obj, 'name') and obj.name == 'Mutable'
][0]
mutable.methods = [m for m in mutable.methods if m.name != 'coerce']
soup.import_path = 'sqlalchemy_mutable'
compile_md(soup, compiler='sklearn', outfile='docs_md/basic.md')

path = 'sqlalchemy_mutable/coerced_types.py'
soup = PySoup(path=path, parser='sklearn', src_href=src_href)
soup.objects = soup.objects[0:1]
compile_md(soup, compiler='sklearn', outfile='docs_md/coerced_types.md')

path = 'sqlalchemy_mutable/model_shell.py'
soup = PySoup(path=path, parser='sklearn', src_href=src_href)
compile_md(soup, compiler='sklearn', outfile='docs_md/model_shell.md')

path = 'sqlalchemy_mutable/mutable_list.py'
soup = PySoup(path=path, parser='sklearn', src_href=src_href)
for obj in soup.objects:
    if hasattr(obj, 'name'):
        if obj.name == 'MutableListType':
            obj.methods.clear()
コード例 #3
0
ファイル: mkdocs.py プロジェクト: dsbowen/smoother
from docstr_md.python import PySoup, compile_md
from docstr_md.src_href import Github

import os

src_href = Github('https://github.com/dsbowen/smoother/blob/master')

path = 'smoother/smoother.py'
soup = PySoup(path=path, parser='sklearn', src_href=src_href)
soup.import_path = 'smoother'
soup.rm_properties()
compile_md(soup, compiler='sklearn', outfile='docs_md/smoother.md')

path = 'smoother/max_entropy.py'
soup = PySoup(path=path, parser='sklearn', src_href=src_href)
soup.import_path = 'smoother'
soup.rm_properties
compile_md(soup, compiler='sklearn', outfile='docs_md/max_entropy.md')

path = 'smoother/utils.py'
soup = PySoup(path=path, parser='sklearn', src_href=src_href)
soup.import_path = 'smoother'
compile_md(soup, compiler='sklearn', outfile='docs_md/utils.md')
コード例 #4
0
from docstr_md.python import PySoup, compile_md
from docstr_md.src_href import Github

import os

src_href = Github('https://github.com/dsbowen/dash-fcast/blob/master')

path = 'dash_fcast/table.py'
soup = PySoup(path=path, parser='sklearn', src_href=src_href)
soup.import_path = 'dash_fcast'
table_cls = soup.objects[-1]
table_cls.rm_methods('to_plotly_json')
compile_md(soup, compiler='sklearn', outfile='docs_md/table.md')

dist_path = 'dash_fcast/distributions'
outfile_path = 'docs_md/distributions'

path = os.path.join(dist_path, '__init__.py')
soup = PySoup(path=path, parser='sklearn', src_href=src_href)
outfile = os.path.join(outfile_path, 'utils.md')
compile_md(soup, compiler='sklearn', outfile=outfile)

dist_files = ('moments', 'table')

for f in dist_files:
    path = os.path.join(dist_path, f + '.py')
    soup = PySoup(path=path, parser='sklearn', src_href=src_href)
    soup.import_path = dist_path
    for obj in soup.objects:
        try:
            obj.rm_methods('to_plotly_json')
コード例 #5
0
from docstr_md.python import PySoup, compile_md
from docstr_md.src_href import Github

src_href = Github('https://github.com/dsbowen/flask-worker/blob/master')

path = 'flask_worker/__init__.py'
soup = PySoup(path=path, parser='sklearn', src_href=src_href)
soup.rm_properties()
compile_md(soup, compiler='sklearn', outfile='docs_md/manager.md')

path = 'flask_worker/worker_mixin.py'
soup = PySoup(path=path, parser='sklearn', src_href=src_href)
soup.rm_properties()
soup.import_path = 'flask_worker'
compile_md(soup, compiler='sklearn', outfile='docs_md/worker_mixin.md')

path = 'flask_worker/router_mixin.py'
soup = PySoup(path=path, parser='sklearn', src_href=src_href)
soup.rm_properties()
soup.import_path = 'flask_worker'
compile_md(soup, compiler='sklearn', outfile='docs_md/router_mixin.md')
コード例 #6
0
from docstr_md.python import PySoup, compile_md
from docstr_md.src_href import Github

src_href = Github('https://github.com/dsbowen/flask-download-btn/blob/master')

path = 'flask_download_btn/__init__.py'
soup = PySoup(path=path, parser='sklearn', src_href=src_href)
compile_md(soup, compiler='sklearn', outfile='docs_md/manager.md')

path = 'flask_download_btn/download_btn_mixin.py'
soup = PySoup(path=path, parser='sklearn', src_href=src_href)
soup.rm_properties()
soup.objects[-1].rm_methods('handle_form_functions', 'create_file_functions')
soup.import_path = 'flask_download_btn'
compile_md(soup, compiler='sklearn', outfile='docs_md/download_btn_mixin.md')