-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from joaovitorsilvestre/improve_bootstrap_process
Improve bootstrap process + fydoc
- Loading branch information
Showing
67 changed files
with
434 additions
and
13,104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,5 @@ | |
src/_compiled | ||
/example/ | ||
**/erl_crash.dump | ||
libs/fy_doc/_env | ||
lib/fython/site | ||
bootstraped |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
def run(project_path): | ||
project_path | ||
|> Fydoc.Scanner.get_functions_defs() | ||
|> Fydoc.Generator.gererate_docs(project_path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
def gererate_docs(module_n_functions, project_path): | ||
module_n_functions | ||
|> Elixir.Enum.map(lambda x: generate_doc(x, project_path)) | ||
|
||
|
||
def generate_doc((module_name, functions), project_path): | ||
sumary = functions | ||
|> Elixir.Enum.with_index() | ||
|> Elixir.Enum.map(lambda (func, index): | ||
Elixir.Enum.join([ | ||
'<a href="#func', index, '" class="function-sumary-header">', | ||
func, | ||
'</a>' | ||
]) | ||
) | ||
|
||
functions = functions | ||
|> Elixir.Enum.with_index() | ||
|> Elixir.Enum.map(lambda (func, index): | ||
Elixir.Enum.join([ | ||
'<h3 class="function-header" id="func', index,'">', | ||
func, | ||
'</h3>' | ||
]) | ||
) | ||
|
||
splited_module_name = module_name |> Elixir.String.split('.') | ||
|
||
file_content = Elixir.Enum.join([ | ||
Elixir.Enum.join(["## ", module_name]), | ||
"### Sumary", | ||
*sumary, | ||
"### Functions", | ||
*functions | ||
], "\n\n") | ||
|
||
result_file_name_with_path = generate_file_path(module_name, project_path) | ||
Elixir.File.mkdir_p!(result_file_name_with_path |> Elixir.Path.dirname()) | ||
|
||
Elixir.File.write(result_file_name_with_path, file_content) | ||
|
||
|
||
def generate_file_path(module_name, project_path): | ||
# returns docs/MyModule/ChildModule.md | ||
Elixir.Enum.join([ | ||
project_path |> Elixir.String.replace_trailing("/", ""), | ||
"/docs/modules/", | ||
module_name |> Elixir.String.split('.') |> Elixir.Enum.join('/'), | ||
".md" | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.function-header { | ||
margin: 2em 0 1em; | ||
padding: 0.5em 1em; | ||
background: #f7f7f7; | ||
border-left: 3px solid #6ecb58; | ||
font-size: 1.2em !important; | ||
font-weight: 700; | ||
font-family: Inconsolata,Menlo,Courier,monospace; | ||
position: relative; | ||
} | ||
|
||
.function-sumary-header { | ||
color: rgb(51, 51, 51) !important; | ||
text-decoration: none !important; | ||
font-weight: 700; | ||
font-size: 1.1em; | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Home | ||
|
||
Documentation generated by fydoc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
site_name: Fython | ||
theme: | ||
name: gitbook | ||
extra_css: ["extra.css"] | ||
extra_javascript: ["extra.js"] | ||
#nav: | ||
# - 'Home': 'index.md' | ||
# - 'Modules': | ||
# - 'Core': | ||
# - Functions: 'modules/core/functions.md' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
click==8.1.3 | ||
ghp-import==2.1.0 | ||
Jinja2==3.1.2 | ||
Markdown==3.3.7 | ||
MarkupSafe==2.1.1 | ||
mergedeep==1.3.4 | ||
mkdocs==1.4.2 | ||
mkdocs-gitbook==0.0.1 | ||
packaging==21.3 | ||
pyparsing==3.0.9 | ||
python-dateutil==2.8.2 | ||
PyYAML==6.0 | ||
pyyaml_env_tag==0.1 | ||
six==1.16.0 | ||
watchdog==2.1.9 |
Oops, something went wrong.