Giter VIP home page Giter VIP logo

docsible's Introduction

Hi there ๐Ÿ‘‹

def work_life_balance(task: str, mood: str = 'neutral') -> str:
    """
    A function to balance work and fun.
    
    Args:
    - task (str): The task to execute.
    - mood (str): Your current mood. Default is 'neutral'.

    Returns:
    - str: A fun yet professional message.
    """
    fun_emojis = {
        'happy': '๐Ÿ˜„',
        'neutral': '๐Ÿ˜',
        'sad': '๐Ÿ˜ž'
    }

    professional_advice = {
        'happy': "Great! But don't forget your responsibilities.",
        'neutral': "Stay balanced, don't overwork or overplay.",
        'sad': "Maybe take a short break and come back stronger."
    }

    if mood not in fun_emojis:
        return "Invalid mood! Please choose between 'happy', 'neutral', or 'sad'."

    return (f"Task to complete: {task} {fun_emojis[mood]}. "
            f"Advice: {professional_advice[mood]}")

# Example usage:
message = work_life_balance("Complete Python project", "happy")
print(message)

docsible's People

Contributors

exaluc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

docsible's Issues

[BUG] In line comments are part of var values

Describe the Bug

If you use inline comment on vars, like example, these become part of "value" in the generated README.md

Environment

  • Docsible Version: 0.5.0
  • Python Version: 3.10
  • Operating System: WSL Ubuntu

To Reproduce

Describe the steps to reproduce the behavior:

  1. create a test variable or default with inline comment like: test_var: value # this is an inline comment
  2. generate the README whit docsible

Expected Behavior

Value without the comment:

The result will be like:

Var Type Value Required Title
test_var str value None None

Actual Behavior

Value with the comment:

Var Type Value Required Title
test_var str value # this is an inline comment None None

[BUG] Include tasks is not handled: Syntax error in text mermaid

Describe the Bug

When task got include, mermaid dont handle it, it's generate include like: |Include| {'file': 'modify.yml'}

Environment

  • Docsible Version: docsible, version 0.6.0

  • Python Version: Python 3.9.2

  • Operating System: Linux

  • CLI or Script: docsible --role ./test --graph

To Reproduce

Describe the steps to reproduce the behavior:

  1. Run the following command docsible --role ./test --graph
  2. Navigate to readme.md
  3. Open readme.md, check the include into mermaid templates

Expected Behavior

Nice template with mermaid.

Actual Behavior

Syntax error in text mermaid version 10.7.0

Incorrect Variable Documentation in Generated README.md

Incorrect Variable Documentation

When using docsible to generate the README.md file, the variable in vars/main.yml is incorrectly documented. The variable cwa_use_proxy is not displayed correctly in the generated README.md file.

The problematic variable in vars/main.yml:

cwa_use_proxy: "{{ true | bool if cwa_http_proxy is defined and cwa_http_proxy | length > 0 else false | bool }}"

The generated README.md file shows:

image

Expected results should be as the variable.

Environment

  • Docsible Version: 0.6.1
  • Python Version: 3.8.2
  • Operating System: Ubuntu

To Reproduce

Describe the steps to reproduce the behavior:

  1. Create a variable in vars/main.yml:
cwa_use_proxy: "{{ true | bool if cwa_http_proxy is defined and cwa_http_proxy | length > 0 else false | bool }}"
  1. Run the following command:
docsible --role . --no-backup --graph --no-docsible

Expected Behavior

Expected results should be as the variable in declared.

Actual Behavior

image

Feature Request: Add Marker for Controlled Appending in README.md

Hi @exaluc, first of all love your work on docsible. I have been using this for generating documents for roles. Thank you for the quick response on the previous bug #12 <3. I would like to request a new feature. It will be a life saver for me.

Currently, docsible overrides the entire content of the README.md file when generating documentation. I would like to request a feature that allows docsible to append content after specific markers, enabling better control over the generated documentation and preserving other parts of the README.md file.

Proposed Solution

Introduce two markers that can be added to the README.md file:

  • <---- begin of docsible --->

docsible should append its generated content only between these markers, leaving the rest of the README.md file intact. If the markers are not present, docsible can default to its current behavior of overriding the entire file.

Environment

Docsible Version: 0.6.2
Python Version: Python 3.8.3
Operating System: Ubuntu

[BUG] array of variables

Describe the Bug

The single variables are OK, but if we have an array of variables it's not working properly

Environment

  • Docsible Version: 0.5.8
  • Python Version: 3.11
  • Operating System: Linux
  • CLI or Script: CLI command in CI/CD gitlab

To Reproduce

here my variables :

fm_hardening_sshd_login_grace_time: true
fm_hardening_openssh_default_policy: true

packages_ssh:

  • openssh
  • openssh-server
  • openssh-clients
  • rpmdevtools

Expected Behavior

Array of variables
packages_ssh | openssh ; openssh-server ; openssh-clients ; rpmdevtools

Actual Behavior

nothing...

extra question

Can we have an explanation on how customize or create template to generate a customized README.md file ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.