question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add onWillSaveNotebookDocument

See original GitHub issue

This would match onWillSaveTextDocument but for notebook docs instead

As parts of this, we should allow extensions to perform notebook edits before the save happens

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
worksofliamcommented, Aug 19, 2022

@jrieken I am asking for it! It’d be very useful, thanks!

Related PR/issue: https://github.com/halcyon-tech/vscode-ibmi/pull/818#issuecomment-1220733058

1reaction
seeMcommented, Aug 30, 2022

We would use this in nbdev (tracking here: https://github.com/fastai/nbdev/issues/952). We remove unneeded metadata from notebooks on-save, for cleaner diffs and less chance of merge conflicts. It’s very easy to implement with Jupyter Notebook/Lab via ContentsManager.pre_save_hook. We add this to the relevant config file:

def nbdev_clean_jupyter(**kwargs):
    try: from nbdev.clean import clean_jupyter
    except ModuleNotFoundError: return
    clean_jupyter(**kwargs)

c.ContentsManager.pre_save_hook = nbdev_clean_jupyter

How could we get similar behaviour for our VSCode users? Is there any workaround while onWillSaveNotebookDocument doesn’t exist?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Word Add-in | Document Generation API | Adobe PDF Services
Word Add-in. Document Generation Word Add-in provides the capability to author templates to generate data-driven Word and PDF documents.
Read more >
How to Add Documents in Targets and Integrations
To Add Documents: Navigate to the Integrations menu. Select All Integrations. Select an Integration from the Integration Name column.
Read more >
Documentation for version 4.0, 4.1 and 4.2 - Add-On Products
Summary During the configuration of Digital Sign Service (DSS) for Server with Active Directory in O365 (Azure AD), we need to create an...
Read more >
Digital Red Book: How to Add Documents to the Library
You can add your own documents to the Library for each location. Add files stored locally or files stored in the cloud. Files...
Read more >
Insert a document or object - Caseware
You can insert documents and objects from a variety of different file formats into a CaseView document. Sub-documents (other CaseView documents); External ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found