Skip to content
New issue

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

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

Already on GitHub? # to your account

New Guides API #2134

Merged
merged 11 commits into from
Nov 26, 2023
Merged

New Guides API #2134

merged 11 commits into from
Nov 26, 2023

Conversation

anjakefala
Copy link
Collaborator

@anjakefala anjakefala commented Nov 23, 2023

New API

  • vd.addGuide("guidename", GuideObj(source='''Text for guide'''))
  • vd.getGuide(guidename) -> Returns the instantiated Sheet for the guide

Add color_h1 for colouring markdown annotated headers (#).

Added a Macros Guide as a proof-of-concept for the API.

  • Look at NoahsPuzzle - text column with displayer='full'
  • Add color_h1 for styling markdown headers
  • Signal somehow in GuideGuide which guides exist, and which don't
  • Move guide.py to VisiData core, and import appropriately

Demo of Guide Sheet and new color_h1.

guide sheet

@anjakefala anjakefala requested a review from saulpw November 23, 2023 07:45
@anjakefala anjakefala marked this pull request as ready for review November 25, 2023 07:03
@anjakefala anjakefala changed the title Prototype for Guides in VisiData New Guides API Nov 25, 2023
visidata/guide.py Outdated Show resolved Hide resolved
[:keys]Backspace[/] to come back to this list of guides
- [:keystrokes]Up/Down[/] to move the row cursor
- [:keystrokes]Enter[/] to view a topic
- [:keystrokes]Backspace[/] to come back to this list of guides
Copy link
Owner

@saulpw saulpw Nov 26, 2023

Choose a reason for hiding this comment

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

I think this (- [:keystrokes]gg[/] to {helpstr}) should be the general pattern for commands.

visidata/guide.py Outdated Show resolved Hide resolved
visidata/guide.py Outdated Show resolved Hide resolved
visidata/guide.py Outdated Show resolved Hide resolved
visidata/guide.py Outdated Show resolved Hide resolved
visidata/guide.py Outdated Show resolved Hide resolved
visidata/interface.py Outdated Show resolved Hide resolved
visidata/macros.py Outdated Show resolved Hide resolved
Add rowdef and rowtype.
guidename -> name
Improve documentation and error messaging.
open-guide -> open-guide-index
Mention macros can be set to both keystrokes and longnames.
Use pattern of "Use command to imperative" for command text.
@anjakefala anjakefala requested a review from saulpw November 26, 2023 05:16
Copy link
Owner

@saulpw saulpw left a comment

Choose a reason for hiding this comment

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

Okay, nice work, we'll merge it and keep developing our style with each new guide!

@anjakefala anjakefala merged commit b5ac95d into develop Nov 26, 2023
12 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants