Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,41 @@ $ marked --help
</body>
</html>
```
<details>

<summary>Render Full Page as Markdown</summary>

```html
<!DOCTYPE html>
<html>
<head>
<!-- Suggested stylesheet -->
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.8.1/github-markdown.min.css"
crossorigin="anonymous" referrerpolicy="no-referrer" />

<title>Marked for the full page</title>
</head>

<body>
<div id="markdown" class="markdown-body">
# Title

Lots of text using **markdown syntax.**
</div>

<script src="https://cdn.jsdelivr.net/npm/marked/lib/marked.umd.js"></script>
<script>
const md = document.getElementById("markdown");

// Parse the markdown formatted data, output as HTML, and render as if markdown.
md.innerHTML = marked.parse(md.textContent);
</script>
</body>
</html>
```
</details>

or import esm module

```html
Expand Down
36 changes: 36 additions & 0 deletions docs/INDEX.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,42 @@ $ marked -s 'line1\nline2' -c config.json
</body>
</html>
```

<details>

<summary>Render Full Page as Markdown</summary>

```html
<!DOCTYPE html>
<html>
<head>
<!-- Suggested stylesheet -->
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.8.1/github-markdown.min.css"
crossorigin="anonymous" referrerpolicy="no-referrer" />

<title>Marked for the full page</title>
</head>

<body>
<div id="markdown" class="markdown-body">
# Title

Lots of text using **markdown syntax.**
</div>

<script src="https://cdn.jsdelivr.net/npm/marked/lib/marked.umd.js"></script>
<script>
const md = document.getElementById("markdown");

// Parse the markdown formatted data, output as HTML, and render as if markdown.
md.innerHTML = marked.parse(md.textContent);
</script>
</body>
</html>
```
</details>

or import esm module

```html
Expand Down