Skip to content

Commit

Permalink
Edit examples
Browse files Browse the repository at this point in the history
  • Loading branch information
monosans committed Apr 26, 2024
1 parent 87dfae9 commit ceed20a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,8 @@ python -m pip install -U pyromark
```python
import pyromark

# Create example Markdown text.
markdown_input = "hello world"

# Convert the Markdown text to HTML.
html_output = pyromark.markdown(markdown_input)
assert html_output == "<p>hello world</p>\n"
html = pyromark.markdown("# Hello world")
assert html == "<h1>Hello world</h1>\n"
```

## Documentation
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl Markdown {
/// Examples:
/// ```python
/// html = md.convert("# Hello world")
/// print(html) # <h1>Hello world</h1>\n
/// assert html == "<h1>Hello world</h1>\n"
/// ```
fn convert(&self, py: Python<'_>, text: &str) -> String {
py.allow_threads(move || {
Expand All @@ -60,7 +60,7 @@ impl Markdown {
/// | pyromark.Extensions.ENABLE_OLD_FOOTNOTES
/// )
/// )
/// print(html) # <h1>Hello world</h1>\n
/// assert html == "<h1>Hello world</h1>\n"
/// ```
#[pyfunction]
#[pyo3(signature = (text, *, extensions = None))]
Expand Down

0 comments on commit ceed20a

Please sign in to comment.