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

Fix docstring examples #604

Merged
merged 4 commits into from
Nov 25, 2020
Merged

Fix docstring examples #604

merged 4 commits into from
Nov 25, 2020

Conversation

brandenchan
Copy link
Contributor

This PR reformats a few code examples in the docstrings so that they render correctly

@PiffPaffM
Copy link
Contributor

It looks good in haystack-website, but we have two ways to format examples:
image
image

Let's agree on one approach.

@brandenchan
Copy link
Contributor Author

brandenchan commented Nov 19, 2020

@PiffPaffM I went for the vertical bar approach because I find that visually a little cleaner, especially on the website. I also put the vertical bar before the opening dictionary brackets so that we have an aligned starting point for each line.

I think I might even indent everything by one tab so there is some separation between vertical bar and dictionary brackets.

Do you have any thoughts or preferences on this?

@PiffPaffM
Copy link
Contributor

PiffPaffM commented Nov 19, 2020

@brandenchan Makes sense to me. I would suggest that we try this out. Let me know when pushed your changes. I will render it on the website and we can have a look.

@brandenchan
Copy link
Contributor Author

@PiffPaffM Ok cool, in the latest commit I have unified all examples to use | and also added spaces between | and the start of the line

@PiffPaffM
Copy link
Contributor

@brandenchan
Here is an example with spaces:
image

Here is an example with out spaces:
image

I would go with the variant with spaces.

@brandenchan brandenchan self-assigned this Nov 25, 2020
@brandenchan brandenchan merged commit ae530c3 into master Nov 25, 2020
@brandenchan brandenchan deleted the docstring_examples branch November 25, 2020 13:19
@bglearning
Copy link
Contributor

@brandenchan The rendering seems to be incorrect now (not sure why exactly, probably due to the vertical bars?)

E.g on the BM25Retriever reference.

Screenshot 2022-11-06 at 21 26 41

Maybe we can create a new issue

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.

None yet

3 participants