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

Documented DebOps fold format as example and fully support it in yaml2rst. #6

Merged
merged 5 commits into from
Jul 19, 2016

Conversation

ypid
Copy link
Member

@ypid ypid commented Jul 12, 2016

@htgoebel Good thing that you waited with the release. There was another extention needed because of a little redesign.

Docs: https://github.com/ypid/yaml2rst/blob/feature/yaml-fold-strip/docs/fold-markers.rst

Related to: #3
Related to: debops/docs#156

ypid added 3 commits July 12, 2016 18:28
Ref: debops/docs#156 (comment)

One thing that @drybjed changed was to go from

  ```YAML
  # Main configuration [[[
  # ------------------
  ```

to:

  ```YAML
  # Main configuration [[[
  # ----------------------
  ```

This has the advantage that in case we ever manage to get syntax highlighting for the embedded RST syntax working in Vim, it will not complain about sections being to short. I tried it but I am not sure if that is possible as the `# ` in the input for the syntax highlighting in Vim would need to be stipped out and then passed to the `rst` syntax highlighting. Ref: http://vim.wikia.com/wiki/Different_syntax_highlighting_within_regions_of_a_file#Extended_version
`--strip-regex` was intentionally limited to the RST part of the input
to avoid problems.
`--yaml-strip-regex` allows to mess with the YAML part of the input if
needed.

Related to: debops#3
Related to: debops/docs#156
ypid added a commit to ypid/docs-1 that referenced this pull request Jul 12, 2016
ypid added a commit to ypid/docs-1 that referenced this pull request Jul 12, 2016
@@ -53,7 +53,9 @@ dist:
examples: PYTHONPATH = .
examples:
PYTHONPATH=.
bin/yaml2rst examples/main.yml examples/main.rst --strip-regex '\s*(:?\[{3}|\]{3})\d?$$'
sed --regexp-extended 's/(\.\. )envvar(::)/\1note\2/;' examples/fold-markers-debops.yml examples/main.yml \
| bin/yaml2rst - examples/main.rst --strip-regex '\s*(:?\[{3}|\]{3})\d?$$' --yaml-strip-regex '^\s{66,67}#\s\]{3}\d?$$'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Huh, This is very hard to read. I suggest using an intermediate target (is it examples/main.yml?)

Copy link
Member Author

@ypid ypid Jul 19, 2016

Choose a reason for hiding this comment

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

Good idea. Done. You might need to use make examples -B now as make does not check all the dependencies of yaml2rst (e. g. when you make a change in the Python module).

@htgoebel
Copy link
Collaborator

Thanks for the quick reaction.

@htgoebel htgoebel merged commit 1a757a4 into debops:develop Jul 19, 2016
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.

2 participants