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

Print specific part of the Markdown by syntax #605

Open
marcelarie opened this issue Apr 11, 2024 · 0 comments
Open

Print specific part of the Markdown by syntax #605

marcelarie opened this issue Apr 11, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@marcelarie
Copy link

marcelarie commented Apr 11, 2024

I've been using glow for a while now, and thought of a few cool features that could make it even better. Not sure if these fit the project's direction, but here they are:

  1. Selective Header Printing: It'd be awesome to print specific headers directly. Something like:
glow --elements=header --patter-=User*

to get all element headers starting with "User".

The elements could be:

  • heading
  • code_block
  • list
  • link
  • image
  • blockquote
  • table
  • hr
  • code
  • emphasis
  • task_list
  • footnote
  • math
  • definition_list
  • html

Another useful example would be to print only code blocks:

glow --elements=code_block

These ideas might be a bit scattered, but in a way I think are related.

  1. Viewing Specific Document Sections: Like tail or head. Quick examples:
    • For the first 10 lines:
glow --head
  • For the last 10 lines:
glow --tail=10
  • For the first 5 lines:
glow --head=5

If it's tricky to implement, maybe a --color-always option could help keep syntax color when piping to head or tail.

@marcelarie marcelarie added the enhancement New feature or request label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant