Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change --json to --output json #128

Merged
merged 4 commits into from
Jul 16, 2024
Merged

change --json to --output json #128

merged 4 commits into from
Jul 16, 2024

Conversation

yshavit
Copy link
Owner

@yshavit yshavit commented Jul 16, 2024

Default is --output markdown.

This way is more flexible in the future, if I want more output formats for whatever reason.

Also fix an unrelated bug in the JSON output, which I found when I added an integ test for it.

Resolves a TODO, in service of #11.

yshavit added 3 commits July 15, 2024 23:40
These also found bugs in the output! D-:
There wasn't actually the major bug I thought I had in the output. I'd
written the markdown as:

    two[1]

... which was just a plain `two`, plus a shorcut link `[1]`. That
shortcut link then got reformatted to a full link.

I'd meant to write the markdown as:

    [two][1].
They were being rendered not as just a single inline, but as individual
items, with a thematic break between each -- as if they were
individually selected, and then output via `-o md`.

The correct form ended up being simpler, too!
Comment on lines -95 to -98
link_reference_placement: ReferencePlacement::Doc, // but we won't actually write them
footnote_reference_placement: ReferencePlacement::Doc, // ditto
inline_options: MdInlinesWriterOptions {
link_format: LinkTransform::Keep, // unused here, but removing it is more refactoring than it's worth
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that I had all these unused options should have keyed me into the fact that something weird was going on! The link_format one I had even noted as a TODO to clean up earlier, but I decided it wasn't worth it in 329d1e4. I guess now it's done right!

be more consistent with others I have
@yshavit yshavit merged commit 4348f46 into main Jul 16, 2024
4 checks passed
@yshavit yshavit deleted the output-flag branch July 16, 2024 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant