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

Change toc var descriptions to be the first sentance of their doc #17

Merged
merged 1 commit into from
Sep 2, 2022

Conversation

ikappaki
Copy link
Contributor

@ikappaki ikappaki commented Sep 1, 2022

Hi,

could you please review patch to change the method the TOC var descriptions are extracted, so that they closer to full sentences. It fixes #16.

Instead of trying to extract the first few words whose total length is less than 80 chars long, it retrieves the text up to the first full sentence stop, as agreed here babashka/process#81 (comment).

Unfortunately, there is no test infrastructure yet, so I've provisionally put the test statements inside a comment block to demonstrate the expected outcome.

Thanks

@ikappaki
Copy link
Contributor Author

ikappaki commented Sep 1, 2022

Example TOC output with this patch

babashka/process:

Table of contents

  • babashka.process - Shell out in Clojure with simplicity and ease.

    • $ - Convenience macro around process.

    • *defaults* - Dynamic var containing overridable default options.

    • check - Takes a process, waits until is finished and throws if exit code is non-zero.

    • destroy - Takes process or map with :proc (java.lang.ProcessBuilder).

    • destroy-tree - Same as destroy but also destroys all descendants.

    • exec - Replaces the current process image with the process image specified by the given path invoked with the given args.

    • pb - Returns a process builder (as record).

    • pipeline - Returns the processes for one pipe created with -> or creates pipeline from multiple process builders.

    • process - Takes a command (vector of strings or objects that will be turned into strings) and optionally a map of options.

    • sh - Convenience function similar to clojure.java.shell/sh that sets :out and :err to :string by default and blocks.

    • shell - Convenience function around process that was originally in babashka.tasks.

    • start - Takes a process builder, calls start and returns a process (as record).

    • tokenize - Tokenize string to list of individual space separated arguments.

@borkdude borkdude merged commit 4f50015 into borkdude:main Sep 2, 2022
# 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.

toc descriptions can be incomplete sentences
2 participants