-
Notifications
You must be signed in to change notification settings - Fork 79
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
New front matter #40
Conversation
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. |
@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 😊 |
@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.. |
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
…orials into new-front-matter
There was a problem hiding this 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 therequirements.txt
file.
scripts/generate_markdowns.py
Outdated
|
||
for notebook in args.notebooks: | ||
for tutorial in index["tutorial"]: | ||
if tutorial["notebook"] in notebook: |
There was a problem hiding this comment.
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 for
s. 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)
There was a problem hiding this comment.
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 :)
@masci - I attempted to update the 'markdowns' workflow but I don't think I got it right.. |
@TuanaCelik I have pushed a change to the workflow |
@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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go!
Good to merge now? Old haystack website is frozen so I guess it'll be safe correct? |
Here's the new generated markdowns. A few things to note:
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.generate_markdowns
scriptalieses
field but I'm not sure, should we add thexxxx.md
version of all of them too?