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

Indentation loss on markdown-style list usage #215

Closed
JakeWharton opened this issue Jul 29, 2020 · 4 comments · Fixed by #216
Closed

Indentation loss on markdown-style list usage #215

JakeWharton opened this issue Jul 29, 2020 · 4 comments · Fixed by #216

Comments

@JakeWharton
Copy link

private val configs by argument("CONFIG")
    .copy(help = """
      |YAML file containing list of coordinates to watch
      |
      |Format:
      |
      |coordinates:
      | - com.example.ping:pong
      | - com.example.fizz:buzz
      |""".trimMargin())
    .path(fs)
    .multiple(required = true)

produces:

Arguments:
  CONFIG  YAML file containing list of coordinates to watch

          Format:

          coordinates:
 - com.example.ping:pong
 - com.example.fizz:buzz
@JakeWharton
Copy link
Author

JakeWharton commented Jul 29, 2020

Surrounding the last three lines with triple backticks fixes it for now

@ajalt
Copy link
Owner

ajalt commented Jul 29, 2020

#216 fixes the indentation loss. For the reasons discussed in #214, the list will now be wrapped into a single paragrah, so you'll still need triple-backtics to render the list the way you want.

Although it wouldn't be impossible to parse markdown lists, it would be pretty hairy. It feels like opening a can of worms to start adding piecemeal markdown support, so I think pre-formatting the list might have to be good enough. If an MPP markdown parser ever comes along, I'd be interested in using it.

@JakeWharton
Copy link
Author

Maybe @saket can help with that? Is Press' markdown parsing a MPP lib that can be used outside the app?

@saket
Copy link

saket commented Jul 29, 2020

Press doesn't have a multiplatform parser yet. I'm planning to use intellij-markdown, which is the same parser that's used by dokka. They have a feature branch that introduces support for JS, but it doesn't do native yet. More info here: JetBrains/markdown#36.

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 a pull request may close this issue.

3 participants