Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
goFrendiAsgard committed Dec 12, 2023
1 parent 8221cab commit 61392b5
Showing 1 changed file with 102 additions and 3 deletions.
105 changes: 102 additions & 3 deletions zrb_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
)

###############################################################################
# Task Definitions
# ⚙️ make-docs
###############################################################################


Expand Down Expand Up @@ -132,14 +132,45 @@ def make_docs(*args: Any, **kwargs: Any):
os.path.join(doc_concept_task_input_dir, 'str-input.md'): StrInput,
}
for file_name, cls in configs.items():
task.print_out(f'Injecting doc for `{cls.__name__}` on {file_name}')
task.print_out(f'Inject `{cls.__name__} docstring` to {file_name}')
inject_doc(file_name, cls)


###############################################################################
# ⚙️ remake-docs
###############################################################################

remake_docs = CmdTask(
name='remake-docs',
cwd=CURRENT_DIR,
envs=[
Env('ZRB_SHOW_TIME', os_name='', default='0')
],
cmd='zrb make-docs'
)

###############################################################################
# ⚙️ auto-make-docs
###############################################################################

auto_make_docs = RecurringTask(
name='auto-make-docs',
description='Make documentation whenever there is any changes in the code',
triggers=[
PathWatcher(path=os.path.join(CURRENT_DIR, '**', '*.py'))
],
task=remake_docs
)
runner.register(auto_make_docs)

###############################################################################
# ⚙️ build
###############################################################################

build = CmdTask(
name='build',
description='Build Zrb',
upstreams=[make_docs],
upstreams=[remake_docs],
cwd=CURRENT_DIR,
cmd=[
'set -e',
Expand All @@ -154,6 +185,10 @@ def make_docs(*args: Any, **kwargs: Any):
skippable_build.set_should_execute('{{ input.build_zrb}}')
runner.register(build)

###############################################################################
# ⚙️ publish-pip
###############################################################################

publish_pip = CmdTask(
name='publish-pip',
description='Publish zrb to pypi',
Expand All @@ -167,6 +202,10 @@ def make_docs(*args: Any, **kwargs: Any):
)
runner.register(publish_pip)

###############################################################################
# ⚙️ publish-pip-test
###############################################################################

publish_pip_test = CmdTask(
name='publish-pip-test',
description='Publish zrb to testpypi',
Expand All @@ -180,6 +219,10 @@ def make_docs(*args: Any, **kwargs: Any):
)
runner.register(publish_pip_test)

###############################################################################
# ⚙️ check-pip
###############################################################################

check_pip = HTTPChecker(
name='check-pip',
inputs=[zrb_version_input],
Expand All @@ -189,6 +232,10 @@ def make_docs(*args: Any, **kwargs: Any):
port=443
)

###############################################################################
# ⚙️ build-image
###############################################################################

build_image = DockerComposeTask(
name='build-image',
description='Build docker image',
Expand All @@ -207,6 +254,10 @@ def make_docs(*args: Any, **kwargs: Any):
)
runner.register(build_image)

###############################################################################
# ⚙️ build-latest-image
###############################################################################

build_latest_image = DockerComposeTask(
name='build-latest-image',
description='Build docker image',
Expand All @@ -228,6 +279,10 @@ def make_docs(*args: Any, **kwargs: Any):
)
runner.register(build_latest_image)

###############################################################################
# ⚙️ stop-container
###############################################################################

stop_container = DockerComposeTask(
name='stop-container',
description='remove docker container',
Expand All @@ -242,6 +297,10 @@ def make_docs(*args: Any, **kwargs: Any):
)
runner.register(stop_container)

###############################################################################
# ⚙️ start-container
###############################################################################

start_container = DockerComposeTask(
name='start-container',
description='Run docker container',
Expand All @@ -263,6 +322,10 @@ def make_docs(*args: Any, **kwargs: Any):
)
runner.register(start_container)

###############################################################################
# ⚙️ push-image
###############################################################################

push_image = DockerComposeTask(
name='push-image',
description='Push docker image',
Expand All @@ -281,6 +344,10 @@ def make_docs(*args: Any, **kwargs: Any):
)
runner.register(push_image)

###############################################################################
# ⚙️ push-latest-image
###############################################################################

push_latest_image = DockerComposeTask(
name='push-latest-image',
description='Push docker image',
Expand All @@ -302,6 +369,10 @@ def make_docs(*args: Any, **kwargs: Any):
)
runner.register(push_latest_image)

###############################################################################
# ⚙️ publish
###############################################################################

publish = FlowTask(
name='publish',
description='Publish new version',
Expand All @@ -312,6 +383,10 @@ def make_docs(*args: Any, **kwargs: Any):
)
runner.register(publish)

###############################################################################
# ⚙️ install-symlink
###############################################################################

install_symlink = CmdTask(
name='install-symlink',
description='Install Zrb as symlink',
Expand All @@ -331,6 +406,10 @@ def make_docs(*args: Any, **kwargs: Any):
skippable_install_symlink.set_should_execute('{{ input.install_symlink}}')
runner.register(install_symlink)

###############################################################################
# ⚙️ test
###############################################################################

test = CmdTask(
name='test',
description='Run zrb test',
Expand All @@ -355,6 +434,10 @@ def make_docs(*args: Any, **kwargs: Any):
)
runner.register(test)

###############################################################################
# ⚙️ serve-test
###############################################################################

serve_test = CmdTask(
name='serve-test',
description='Serve zrb test result',
Expand Down Expand Up @@ -382,6 +465,10 @@ def make_docs(*args: Any, **kwargs: Any):
)
runner.register(serve_test)

###############################################################################
# ⚙️ create
###############################################################################

create_playground = CmdTask(
name='create',
description='Create playground',
Expand All @@ -401,6 +488,10 @@ def make_docs(*args: Any, **kwargs: Any):
skippable_create_playground.set_should_execute('{{ input.create_playground}}')
runner.register(create_playground)

###############################################################################
# ⚙️ test-fastapp
###############################################################################

test_fastapp_playground = CmdTask(
name='test-fastapp',
description='Test Fastapp',
Expand All @@ -416,6 +507,10 @@ def make_docs(*args: Any, **kwargs: Any):
)
runner.register(test_fastapp_playground)

###############################################################################
# ⚙️ test-install-symlink
###############################################################################

test_install_playground_symlink = CmdTask(
name='test-install-symlink',
description='Test installing symlink',
Expand All @@ -431,6 +526,10 @@ def make_docs(*args: Any, **kwargs: Any):
)
runner.register(test_install_playground_symlink)

###############################################################################
# ⚙️ test-playground
###############################################################################

test_playground = CmdTask(
name='test',
description='Test playground',
Expand Down

0 comments on commit 61392b5

Please sign in to comment.