Is there a way to detect whether a page is being displayed in the »Preview« window or generated using »Export as HTML«?
I would like to use the Preview option to view certain attributes and settings that I don’t need to display in the exported version. This would help me debug my notes and material mor quickly.
### Pseudocode
if(PreviewWindow==1)
^value($SomeAttributeToCheck)^
else
// Do nothing as »Export as HTML« is used
endif
Not at present. That also means that swapping out templates doesn’t help as you’d need to decide beforehand which text pane to use.
Confusion arises as originally the intention of preview was to check export output without generating export file(s). Then came people wanting to use Markdown or just HTML as an internal reading mode with styles, scripts etc./ This lead to increased issues re OS security controls. So now (v11.x as I write) Preview is one pane doing two discrete tasks: export preview and internal viewing.
I’m wondering if allowing action code access to text pane selected sub-pane might not introduce a new problem for export users. IIRC export doesn’t generate a new file if the file already exists on disk (i.e. already exported/previews) and the title/text/Displayed Attributes have not altered. That made sense 20 years back but use of export and preview, and page content complexity have changed. I don’t know what the correct answer is here, but note this latter fact lest a ‘simple’ fix to tell text pane in use generates a new headache for other users.
This is not quite correct. Export will not reexport a page if the new export is identical to the file previously exported. As a result, if the old file has been synced to a server, a new export only required uploading changed files.