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

RunMe CellIDs Don't Play Well With Hugo #663

Open
jlewi opened this issue Sep 4, 2024 · 2 comments
Open

RunMe CellIDs Don't Play Well With Hugo #663

jlewi opened this issue Sep 4, 2024 · 2 comments

Comments

@jlewi
Copy link
Contributor

jlewi commented Sep 4, 2024

RunMe notebooks can't be published in a hugo website.
When I try to render a hugo site with a notebook I get an error like the following

Error: error building site: "/Users/jlewi/git_foyle/docs/content/en/docs/use-cases/search_and_extract_gmail.md:23:4": failed to parse Markdown attributes; you may need to quote the values

This was with hugo v0.117.0. This is a bit dated so its possible it is fixed with a newer version.
(The Foyle website or docsy theme doesn't work with newer versions of hugo so I couldn't test this).

The problem appears to be the markdown attributes in code blocks where RunMe stores the CellID.

It looks like this is a known issue.
gohugoio/hugo#10835

WorkAround

It looks like a work around is to set the RunMe LifeCycle Identity option to None so CellIDs aren't added.
Note you need to reload the developer window.

@jlewi
Copy link
Contributor Author

jlewi commented Sep 4, 2024

Some additional discussion in this discord thread
https://discord.com/channels/1102639988832735374/1245202404149035109/1245378500865556512

@jlewi
Copy link
Contributor Author

jlewi commented Sep 6, 2024

I think one issue with the WorkAround is that Foyle always adds CellIDs and these don't get stripped by setting the lifecycle to none. We also need to keep the cellIds in memory at least in order to properly collect feedback.

jlewi added a commit to jlewi/foyle that referenced this issue Sep 12, 2024
* Learning was broken because cell executions were not being properly
extracted from LogEvents and added to the BlockLog.
* The problem is that the logging of LogEvents happens inside an
anonymous function. Therefore the function name generated by GoLang has
a suffix like "func1"; therefore our code in the Analyzer was not
correctly matching it and therefore log events were not being processed.
* The fix is to match by using `HasPrefix`. This is still brittle. 
* Per #232 we'd like to start to fix this brittleness by using
reflection and source code analysis in unittests to ensure the
correctness of matchers for LogEntries.
* This PR introduces a matchers package which verifies correctness of
the function name but doesn't properly catch the anonymous function
which broke learning here

* Update the troubleshooting guide for learning
  * Move the troubleshooting guide into the docs page
* Update the instructions for fetching the blocklogs; we now use the
connect protocol

## Strip metadata from markdown

* Create a simple tool to strip cell ids from markdown.
* This is hack to make it easy to use RunMe markdown docs with Hugo; see
stateful/runme#663
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

No branches or pull requests

1 participant