Not sure if this would be possible to do, but it would be nice to not automatically pin certain types of cells when creating them.
Specifically, when first running a newly created cell, if the cell is an expression cell consisting of an md tagged template, or is an import cell, it should not be pinned.
This is because md templates are often used for documentation or human-readable instructions, so most of the time, seeing the source just duplicates the rendered text. Additionally, the nice display for import cells makes the actual import statement duplicative unless there is a with clause.
Good point, but it’s only one more click to open the code section again; or you could click to pin the ones you plan to add to.
The two cases I chose mitigate this issue, since the output is very similar to the code. Additionally, the code block only collapses when you focus out of it.
IMO this behavior is kind of intuitive, and it’s always just one click to reverse the behavior
I’m not sure If i have the shortcut right but I find ‘P’ very easy to pin or unpin a cell with focus.
My only worry when working with firefox is to pass from the edit state to the focus state without having to blur the cell with ‘ESC’ then reselect it with ‘J’ or ‘K’.
The shortcut ‘CRTL-SHIFT P’ does probably that but because in firefox it is already taken to open a ‘private navigation window’ and in chromium to print the page, I cannot use it.
But if you can use ‘CRTL-SHIFT P’ to unpin a cell directly from the edit mode while keeping the focus on it, do you really need an automatic cell unpin based on content analysis ? But maybe I miss understood the problem.
Just to add another aspect to the conversation: Lately I’m seeing a lot of notebooks with pinned title cells. I assume that many authors simply don’t notice the single line code block (and perhaps some just don’t care).