Skip to content

Commit

Permalink
Changed name to yaml-to-markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
anevis committed Apr 6, 2024
1 parent 7e26898 commit 22f7d80
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 19 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,7 @@ jobs:
run: devbox run build
- name: 🚀 Publish to PyPI
run: devbox run publish
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
- run: echo "🍏 This job's status is ${{ job.status }}."
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# JSON to Markdown Converter
# YAML to Markdown Converter

A Python utility to take a JSON / YAML file or a python dict / list and create a Markdown file.

Expand All @@ -8,7 +8,7 @@ A Python utility to take a JSON / YAML file or a python dict / list and create a

#### Convert a Pyton dictionary to Markdown:
```python
from json_to_markdown.md_converter import MDConverter
from yaml_to_markdown.md_converter import MDConverter

data = {
"name": "John Doe",
Expand Down Expand Up @@ -39,12 +39,12 @@ You can also use the command line interface to convert a JSON or YAML file to Ma

#### Convert a JSON file to Markdown:
```bash
python json_to_markdown/convert.py --output-file output.md --json-file test.json
python yaml_to_markdown/convert.py --output-file output.md --json-file test.json
```

#### Convert a YAML file to Markdown:
```bash
python json_to_markdown/convert.py --output-file output.md --yaml-file test.yaml
python yaml_to_markdown/convert.py --output-file output.md --yaml-file test.yaml
```

## Developer Guide
Expand Down
7 changes: 4 additions & 3 deletions devbox.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"$schema": "https://raw.githubusercontent.com/jetpack-io/devbox/0.10.3/.schema/devbox.schema.json",
"packages": ["[email protected]"],
"env": {
"VENV_DIR": "$HOME/MyFiles/programming/OpenSource/yaml-to-markdown/.devbox/virtenv/python/.venv",
"TWINE_USERNAME": "__token__"
},
"shell": {
"env": {
"VENV_DIR": "$HOME/MyFiles/programming/OpenSource/json-to-markdown/.devbox/virtenv/python/.venv"
},
"init_hook": [
". $VENV_DIR/bin/activate"
],
Expand Down
4 changes: 2 additions & 2 deletions docs/DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ devbox run install-dev

The functionality can be used in the command line or in Python code.

To use the functionality in Python code, you can import the `MDConverter` class from the `json_to_markdown.md_converter` module.
To use the functionality in Python code, you can import the `MDConverter` class from the `yaml_to_markdown.md_converter` module.
The `md_converter.py` file contains the `MDConverter` class, which is used by the `convert` function to perform the conversion.

To use the functionality from the command line, you can run the `convert.py` script in the `json_to_markdown` directory.
To use the functionality from the command line, you can run the `convert.py` script in the `yaml_to_markdown` directory.
This file contains the `convert` function, which takes a JSON or YAML file and converts it to Markdown.

## Testing
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
long_description = fh.read()

setup(
name="json-to-markdown",
name="yaml-to-markdown",
version=f"0.1.{ts}",
packages=find_packages(where="src"),
package_dir={"": "src"},
url="https://anevis.github.io/json-to-markdown/",
url="https://anevis.github.io/yaml-to-markdown/",
license="MIT",
author="anevis",
install_requires=[
Expand All @@ -23,7 +23,7 @@
],
entry_points={
"console_scripts": [
"json-to-markdown=json_to_markdown.convert:main",
"yaml-to-markdown=yaml_to_markdown.convert:main",
],
},
long_description=long_description,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import click
import yaml

from json_to_markdown.md_converter import MDConverter
from yaml_to_markdown.md_converter import MDConverter


def _get_json_data(json_file: str) -> Dict[str, Any]:
Expand All @@ -21,7 +21,7 @@ def _get_yaml_data(yaml_file: str) -> Dict[str, Any]:
def _help() -> None:
click.echo("Convert JSON or YAML to Markdown.")
click.echo(
"Usage: json-to-markdown -o <output_file> [-y <yaml_file> | -j <json_file>]"
"Usage: yaml-to-markdown -o <output_file> [-y <yaml_file> | -j <json_file>]"
)
click.echo(
" -o, --output-file <output_file>: Path to the output file as a string [Mandatory]."
Expand All @@ -36,7 +36,7 @@ def _help() -> None:
click.echo(
"Note: Either yaml_file or json_file is required along with output_file."
)
click.echo("Example: json-to-markdown -o output.md -y data.yaml")
click.echo("Example: yaml-to-markdown -o output.md -y data.yaml")


@click.command()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import pytest

from json_to_markdown.convert import convert
from yaml_to_markdown.convert import convert

_JSON_DATA = '{"key": "value"}'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import Any, Dict, IO, List, Optional, Union, Callable

from json_to_markdown.utils import convert_to_title_case
from yaml_to_markdown.utils import convert_to_title_case


class MDConverter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pytest
from mock import mock

from json_to_markdown.md_converter import MDConverter
from yaml_to_markdown.md_converter import MDConverter

_TABLE_ITEMS = [
{
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from json_to_markdown.utils import convert_to_title_case
from yaml_to_markdown.utils import convert_to_title_case


class TestUtils:
Expand Down

0 comments on commit 22f7d80

Please sign in to comment.