Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
323 changes: 323 additions & 0 deletions blog/2026-11-19-html-preview-missing-assets/index.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/01-Getting Started/02-quick-start-project.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ You can open a folder from your desktop in Phoenix Code by following these steps

> The **Open Folder** feature is not supported in Firefox browser due to local folder access restrictions. Please use Chrome, Edge, or Opera for working with local folders.

If you started with a single file in the [HTML Viewer](https://phcode.dev/tools/html-viewer.html), see [why an HTML preview may be missing CSS, images or JavaScript](/blog/html-preview-missing-css-images-javascript). The guide explains when to open the complete project folder.

![Open Folder Image](../images/quickStartProject/open-folder.png "Click on Open Folder to work with local folders")


Expand Down
82 changes: 81 additions & 1 deletion scripts/tutorial-media-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,60 @@
"Visible muted playback, offscreen pause, reader pause preservation, seeking, reduced-motion manual playback, keyboard FAQ use, and watch-page return navigation verified in Chrome",
"Article-to-watch-page navigation and return each retain one VideoObject without duplicate metadata"
]
},
{
"file": "static/tutorials/media/html-preview-hosted-resources.mp4",
"product": "Phoenix Code HTML Viewer",
"product_url": "https://phcode.dev/tools/html-viewer.html",
"project": "Hosted version of the image-text-layout stylesheet and woodland photo",
"workflow": "The hosted example from the guide is already in HTML Viewer. Turn on Allow external resources to load its stylesheet and woodland photo from docs.phcode.dev. Scripts stay off; this setting does not open neighboring files on your computer.",
"captured_at": "2026-11-19T15:14:46.032Z",
"platform": "Chromium 147.0.7727.15 on Linux",
"edition": "Free browser-based HTML Viewer",
"on_screen_instructions": true,
"highlighted_controls": true,
"system_file_picker_recorded": false,
"duration_seconds": 11.4,
"duration_limit_seconds": 30,
"frame_size": [
638,
742
],
"caption_placement": "Instruction strip above the actual screen recording, clear of application and player controls",
"verification": [
"Hosted requests absent with external access off",
"Image naturalWidth is zero before access",
"Real docs stylesheet changes body background to rgb(248, 247, 242)",
"Real docs photo loads after access"
],
"presentation": "Real pointer actions in the live HTML Viewer, recorded at original timing. The crop focuses on preview settings and the rendered result. A pointer and temporary control outline are annotations; product layout, text, and state are unchanged. Analytics were blocked and inputs contain only the public practice examples."
},
{
"file": "static/tutorials/media/html-preview-inline-javascript.mp4",
"product": "Phoenix Code HTML Viewer",
"product_url": "https://phcode.dev/tools/html-viewer.html",
"project": "Self-contained HTML and inline Test button from the troubleshooting article",
"workflow": "The guide’s self-contained HTML example and Test button are already in the source. Click with scripts off, enable Allow external resources and Run scripts, then click again to see Clicked. This demonstrates inline code, not an external script file.",
"captured_at": "2026-11-19T15:14:46.032Z",
"platform": "Chromium 147.0.7727.15 on Linux",
"edition": "Free browser-based HTML Viewer",
"on_screen_instructions": true,
"highlighted_controls": true,
"system_file_picker_recorded": false,
"duration_seconds": 17.533333,
"duration_limit_seconds": 30,
"frame_size": [
638,
742
],
"caption_placement": "Instruction strip above the actual screen recording, clear of application and player controls",
"verification": [
"Exact article example",
"Button unchanged after click with scripts disabled",
"External permission reveals the scripts control",
"Button becomes Clicked after both permissions and a real click"
],
"presentation": "Real pointer actions in the live HTML Viewer, recorded at original timing. The crop focuses on preview settings and the rendered result. A pointer and temporary control outline are annotations; product layout, text, and state are unchanged. Analytics were blocked and inputs contain only the public practice examples."
}
],
"sample_photo": {
Expand Down Expand Up @@ -232,5 +286,31 @@
]
},
"presentation": "Separate walkthroughs for each tutorial task or edition, with screenshots and native video controls",
"playback": "Muted inline autoplay when visible; pauses offscreen and in hidden tabs, preserves the reader's pause, and starts manually for reduced-motion preferences"
"playback": "Muted inline autoplay when visible; pauses offscreen and in hidden tabs, preserves the reader's pause, and starts manually for reduced-motion preferences",
"html_preview_screenshots": [
{
"file": "static/tutorials/media/html-preview-inline-result.png",
"product": "Phoenix Code HTML Viewer",
"product_url": "https://phcode.dev/tools/html-viewer.html",
"captured_at": "2026-11-19T15:14:46.032Z",
"capture": "The article’s exact self-contained example, external resources off",
"presentation": "Actual HTML Viewer screenshot with synthetic example data; analytics blocked; product UI unchanged"
},
{
"file": "static/tutorials/media/html-preview-hosted-result.png",
"product": "Phoenix Code HTML Viewer",
"product_url": "https://phcode.dev/tools/html-viewer.html",
"captured_at": "2026-11-19T15:14:46.032Z",
"capture": "Hosted CSS and photo loaded with external access on and scripts off",
"presentation": "Actual HTML Viewer screenshot with synthetic example data; analytics blocked; product UI unchanged"
},
{
"file": "static/tutorials/media/html-preview-mobile-settings.png",
"product": "Phoenix Code HTML Viewer",
"product_url": "https://phcode.dev/tools/html-viewer.html",
"captured_at": "2026-11-19T15:14:46.032Z",
"capture": "Expanded mobile Preview settings, external access on and Run scripts still off",
"presentation": "Actual HTML Viewer screenshot with synthetic example data; analytics blocked; product UI unchanged"
}
]
}
7 changes: 5 additions & 2 deletions scripts/verify-tutorials.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@ const {PUBLICATIONS_PATH, validatePublications} = require('../plugins/tutorial-m
const imageVideos = require('../src/data/image-tutorial-videos.json');
const pngPdfVideos = require('../src/data/png-pdf-videos.json');
const layoutVideos = require('../src/data/layout-tutorial-videos.json');
const htmlPreviewVideos = require('../src/data/html-preview-videos.json');

const SITE = path.join(__dirname, '..');
const ORIGIN = 'https://docs.phcode.dev';
const GUIDES = ['tutorials', 'tutorials/add-images', 'tutorials/link-pages',
'tutorials/share-website', 'tutorials/bootstrap', 'tutorials/run-python',
'tutorials/find-and-replace', 'tutorials/replace-in-files', 'Features/find-in-files',
'tutorials/image-text-layout', 'tutorials/edit-text-fonts'];
const BLOGS = ['how-to-convert-png-to-pdf-free-online', 'how-to-convert-png-to-pdf-without-losing-quality'];
const BLOGS = ['how-to-convert-png-to-pdf-free-online', 'how-to-convert-png-to-pdf-without-losing-quality',
'html-preview-missing-css-images-javascript'];
const ARTICLE_ROUTES = [...GUIDES.map(guide => '/docs/' + guide), ...BLOGS.map(slug => '/blog/' + slug)];
const WATCH_VIDEOS = [...Object.values(imageVideos), ...Object.values(pngPdfVideos), ...Object.values(layoutVideos)];
const WATCH_VIDEOS = [...Object.values(imageVideos), ...Object.values(pngPdfVideos), ...Object.values(layoutVideos),
...Object.values(htmlPreviewVideos)];

function videoDuration(file) {
const data = fs.readFileSync(file);
Expand Down
7 changes: 7 additions & 0 deletions src/components/Video/HtmlPreviewVideo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react';
import RecordedVideo from './RecordedVideo';
import videos from '@site/src/data/html-preview-videos.json';

export default function HtmlPreviewVideo({topic, showWatchLink = false}) {
return <RecordedVideo video={videos[topic]} showWatchLink={showWatchLink} />;
}
29 changes: 29 additions & 0 deletions src/css/html-preview-guide.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* Follow the existing blog figure rhythm and shared native video player. */
.html-preview-figure {
margin: 1.5rem 0 2rem;
}

.html-preview-figure img {
display: block;
width: 100%;
height: auto;
}

.html-preview-figure figcaption {
margin-top: 0.75rem;
color: var(--ifm-color-content-secondary);
font-size: 0.9375rem;
line-height: 1.5;
}

.html-preview-mobile-figure {
max-width: 20.125rem;
}

.html-preview-video {
max-width: 39.875rem;
}

.html-preview-video video {
display: block;
}
50 changes: 50 additions & 0 deletions src/data/html-preview-videos.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"hosted": {
"watchPath": "/videos/html-viewer-hosted-resources",
"guidePath": "/blog/html-preview-missing-css-images-javascript#distinguish-hosted-addresses-from-relative-paths",
"title": "Load hosted CSS and images in HTML Viewer",
"context": "The hosted example from the guide is already in HTML Viewer. Turn on Allow external resources to load its stylesheet and woodland photo from docs.phcode.dev. Scripts stay off; this setting does not open neighboring files on your computer.",
"source": "/tutorials/media/html-preview-hosted-resources.mp4",
"poster": "/tutorials/media/html-preview-hosted-resources-poster.png",
"captions": "/tutorials/media/html-preview-hosted-resources.vtt",
"label": "Load hosted CSS and images in HTML Viewer: a silent recording of the real controls and result",
"metadata": {
"name": "Load hosted CSS and images in HTML Viewer",
"description": "The hosted example from the guide is already in HTML Viewer. Turn on Allow external resources to load its stylesheet and woodland photo from docs.phcode.dev. Scripts stay off; this setting does not open neighboring files on your computer.",
"duration": "PT11.4S",
"dateCreated": "2026-11-19"
},
"width": 638,
"height": 742,
"instructions": [
"The hosted stylesheet and photo are blocked.",
"Turn on Allow external resources.",
"The real hosted styles and image now load."
]
},
"scripts": {
"watchPath": "/videos/html-viewer-inline-javascript",
"guidePath": "/blog/html-preview-missing-css-images-javascript#check-a-small-javascript-interaction",
"title": "Test inline JavaScript in HTML Viewer",
"context": "The guide’s self-contained HTML example and Test button are already in the source. Click with scripts off, enable Allow external resources and Run scripts, then click again to see Clicked. This demonstrates inline code, not an external script file.",
"source": "/tutorials/media/html-preview-inline-javascript.mp4",
"poster": "/tutorials/media/html-preview-inline-javascript-poster.png",
"captions": "/tutorials/media/html-preview-inline-javascript.vtt",
"label": "Test inline JavaScript in HTML Viewer: a silent recording of the real controls and result",
"metadata": {
"name": "Test inline JavaScript in HTML Viewer",
"description": "The guide’s self-contained HTML example and Test button are already in the source. Click with scripts off, enable Allow external resources and Run scripts, then click again to see Clicked. This demonstrates inline code, not an external script file.",
"duration": "PT17.533333S",
"dateCreated": "2026-11-19"
},
"width": 638,
"height": 742,
"instructions": [
"With scripts off, the button does nothing.",
"First, turn on Allow external resources.",
"Then turn on Run scripts.",
"Click Test button again.",
"Clicked confirms the inline code ran."
]
}
}
7 changes: 7 additions & 0 deletions src/pages/videos/html-viewer-hosted-resources.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react';
import VideoWatchPage from '@site/src/components/Video/VideoWatchPage';
import videos from '@site/src/data/html-preview-videos.json';

export default function HtmlPreviewHostedVideo() {
return <VideoWatchPage video={videos.hosted} guideLinkText="Read the HTML preview troubleshooting steps" />;
}
7 changes: 7 additions & 0 deletions src/pages/videos/html-viewer-inline-javascript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react';
import VideoWatchPage from '@site/src/components/Video/VideoWatchPage';
import videos from '@site/src/data/html-preview-videos.json';

export default function HtmlPreviewScriptsVideo() {
return <VideoWatchPage video={videos.scripts} guideLinkText="Read the HTML preview troubleshooting steps" />;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
10 changes: 10 additions & 0 deletions static/tutorials/media/html-preview-hosted-resources.vtt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
WEBVTT

00:00:00.000 --> 00:00:03.224
The hosted stylesheet and photo are blocked.

00:00:03.224 --> 00:00:07.212
Turn on Allow external resources.

00:00:07.212 --> 00:00:11.400
The real hosted styles and image now load.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
16 changes: 16 additions & 0 deletions static/tutorials/media/html-preview-inline-javascript.vtt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
WEBVTT

00:00:00.000 --> 00:00:04.434
With scripts off, the button does nothing.

00:00:04.434 --> 00:00:07.819
First, turn on Allow external resources.

00:00:07.819 --> 00:00:11.212
Then turn on Run scripts.

00:00:11.212 --> 00:00:14.022
Click Test button again.

00:00:14.022 --> 00:00:17.526
Clicked confirms the inline code ran.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading