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

New front matter #40

Merged
merged 17 commits into from
Oct 20, 2022
Merged

New front matter #40

merged 17 commits into from
Oct 20, 2022

Conversation

TuanaCelik
Copy link
Member

Here's the new generated markdowns. A few things to note:

  • I took out the 'category' fields from the list in index.toml as we aren't using them yet and we still have to finalize a 'categories' list if we are going to go ahead with it with docs team.
  • So as to test out the 'catrogory' filed I've pre-filled them all with QA in the generate_markdowns script
  • I've created an alieses field but I'm not sure, should we add the xxxx.md version of all of them too?

@TuanaCelik TuanaCelik requested a review from masci October 3, 2022 18:33
@agnieszka-m
Copy link
Contributor

Hey @TuanaCelik, If I'm not wrong, the "category" field was added because it's required if you want to sync github files with readme.io so. But I think we can use it for the tags we talked about at re.base.

One thing I wanted to ask - where is the "description" field used? Is it the description used by Google by any chance? I can see some tutorials are missing it, I'll be happy to work on them.

@TuanaCelik
Copy link
Member Author

@agnieszka-m I am not sure what category field you're talking about but these are the the ones that we use to filter tutorials (like select the ones that are about "QA", "Summarizing" etc) on Haystack Home - they're not anything left over from the readme.io. I only took them out because a) we haven't narrowed down the list of "categories" yet and so b) the filter on Haystack Home is commented out. This is a separate exercise to decide if we want them and then we can add them back in.

As for the description yes it's used. It's the "lorem ipsum" you see under each title when you go to the tutorials page on HH. So that would be nice to have 😊

@TuanaCelik
Copy link
Member Author

@masci - I want to push one final commit that just adds the 'last_updated_ to each tutorial if we had this info in the previous nextesque frontmatter already. If they weren't up to date we can just run this script for each tutorial and they will start with a new 'last_updated' date :)

@TuanaCelik
Copy link
Member Author

@masci - I want to push one final commit that just adds the 'last_updated_ to each tutorial if we had this info in the previous nextesque frontmatter already. If they weren't up to date we can just run this script for each tutorial and they will start with a new 'last_updated' date :)

I just checked and we had only the 'date' which look like date created. Are you ok if all of the last_updated dates are set to today? They will start changing soon I thin as the docs team are revamping them..

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Contributor

@masci masci left a comment

Choose a reason for hiding this comment

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

  • Left a comment about a possible refactoring of the nested loops. Given the number of tutorials we can afford the quadratic complexity so pick whatever version you think it's more readable.
  • Let's add tomli to the requirements.txt file.


for notebook in args.notebooks:
for tutorial in index["tutorial"]:
if tutorial["notebook"] in notebook:
Copy link
Contributor

Choose a reason for hiding this comment

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

I had the impression offline that you weren't happy with the nested fors. One solution might be creating a map pointing each notebook name to the tutorial configuration dict from the index:

nb_name -> tutorial_dict_containing_nb

This way you would cycle the index only once to build the map, then you can access it how many times you want in O(1) using the notebook name.

The code would look like this:

    ...
    index = read_index(args.index)
    # map the notebook name to the corresponding tutorial
    nb_to_tutorial_cfg = {cfg["notebook"]: cfg for cfg in index["tutorial"]}

    for notebook in args.notebooks:
        # extract the notebook name from whatever path was passed to the script
        nb_name = Path(notebook).name
        tutorial_cfg = nb_to_tutorial_cfg.get(nb_name)
        # convert the tutorial if the notebook is valid
        if tutorial_cfg:
            generate_markdown_from_notebook(index["config"], tutorial_cfg, args.output, notebook)

Copy link
Member Author

Choose a reason for hiding this comment

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

I've basically copied this over :)

@TuanaCelik
Copy link
Member Author

@masci - I attempted to update the 'markdowns' workflow but I don't think I got it right..
Ideally we would check for a diff in the tutorials directory and run 'generate_markdowns' for that correct? Or at least check that a markdown was generated if there is an update on a .ipynb file

@masci
Copy link
Contributor

masci commented Oct 12, 2022

@TuanaCelik I have pushed a change to the workflow

@masci
Copy link
Contributor

masci commented Oct 12, 2022

@TuanaCelik the workflow should be good, CI is failing presumably because the markdowns in this PR have an older date and should be re-generated and re-pushed

@TuanaCelik TuanaCelik requested a review from masci October 13, 2022 13:40
Copy link
Contributor

@masci masci left a comment

Choose a reason for hiding this comment

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

Good to go!

@TuanaCelik
Copy link
Member Author

Good to merge now? Old haystack website is frozen so I guess it'll be safe correct?
Then I can merge this and create a PR to update the contributing guidelines?

@masci masci merged commit 9d3f5e5 into main Oct 20, 2022
@masci masci deleted the new-front-matter branch October 20, 2022 15:11
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