# How the beautiful-article skill transforms URLs and documents into HTML articles

> Learn how to transform URLs and documents into HTML articles with this standard implementation. Discover content fetching, parsing, sanitization, and semantic HTML generation.

- Repository: [ConardLi/garden-skills](https://github.com/ConardLi/garden-skills)
- Tags: how-to-guide
- Published: 2026-08-28

---

**The beautiful-article skill does not exist in the ConardLi/garden-skills repository, so no implementation details are available; however, a standard implementation would fetch remote content, parse the document structure, sanitize the markup, and generate semantic HTML articles.**

The ConardLi/garden-skills repository hosts automation scripts and AI-powered utilities, including the `gpt-image-2` skill for image generation. Despite references to a **beautiful-article** capability that converts URLs and documents into clean HTML, the source code analysis confirms this skill is absent from the current codebase.

## Repository Analysis: Absence of the beautiful-article Skill

During source code analysis, systematic searches for filenames and directories matching `beautiful*` and `article` patterns returned no results. The repository tree only contains `website/` and `skills/gpt-image-2/`, with no `skills/beautiful-article/` directory present. This confirms the skill is not implemented in the current version of ConardLi/garden-skills.

## Expected Implementation Pattern for URL-to-HTML Conversion

Although the skill is missing, the typical architecture for such a feature follows a four-stage pipeline. Based on the patterns used in the existing `skills/gpt-image-2/` directory and standard Node.js practices, the implementation would likely reside in [`skills/beautiful-article/index.js`](https://github.com/ConardLi/garden-skills/blob/main/skills/beautiful-article/index.js) and execute the following workflow:

### Fetching Target Content

The skill would initiate an HTTP request to retrieve raw content from a supplied URL. In a Node.js environment, this typically uses `axios` or the native `fetch` API to handle network operations:

```javascript
const axios = require('axios');

async function fetchContent(url) {
  const response = await axios.get(url);
  return response.data;
}

```

### Parsing and Extraction

After retrieval, the skill would parse the HTML to isolate the main article body, metadata, and images. Libraries such as `jsdom` or `cheerio` extract semantic elements while discarding navigation bars, advertisements, and footers:

```javascript
const { JSDOM } = require('jsdom');

function extractArticle(html) {
  const dom = new JSDOM(html);
  const document = dom.window.document;
  
  const title = document.querySelector('h1')?.textContent || 'Untitled';
  const body = document.querySelector('article') || document.querySelector('main');
  
  return { title, html: body?.innerHTML || '' };
}

```

### Sanitization and Styling

The extracted markup undergoes cleaning to remove inline scripts, normalize image URLs, and apply a consistent CSS theme. This step ensures the output is safe for embedding and visually uniform:

```javascript
const DOMPurify = require('isomorphic-dompurify');

function cleanAndStyle(html) {
  const clean = DOMPurify.sanitize(html, { 
    ALLOWED_TAGS: ['p', 'h1', 'h2', 'h3', 'img', 'a', 'strong', 'em'] 
  });
  return `<div class="article-body">${clean}</div>`;
}

```

### HTML Generation

Finally, the skill would inject the cleaned content into a semantic HTML template, returning a complete document string ready for rendering:

```javascript
function generateHTML(title, bodyContent) {
  return `
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>${title}</title>
  <link rel="stylesheet" href="/styles/article.css">
</head>
<body>
  <article>
    <h1>${title}</h1>
    ${bodyContent}
  </article>
</body>
</html>
  `;
}

```

## Verifying Skill Existence in garden-skills

To confirm whether the beautiful-article skill is available in your local clone or deployment, inspect the `skills/` directory:

```bash
ls -la skills/

# Expected output: gpt-image-2

# Missing: beautiful-article

```

If the directory is absent, the skill functionality is not implemented in that version of the repository.

## Summary

- The **beautiful-article** skill is not implemented in the ConardLi/garden-skills repository.
- The codebase only contains `skills/gpt-image-2/` and `website/` directories at the top level.
- A complete implementation would require four stages: **content fetching**, **document parsing**, **markup sanitization**, and **HTML templating**.
- Developers looking to add this feature should create a new `skills/beautiful-article/` directory with an entry point handling URL input and HTML output.

## Frequently Asked Questions

### Is the beautiful-article skill included in the garden-skills repository?

No. Source code analysis confirms the skill is not present. The repository only contains the `gpt-image-2` skill under `skills/gpt-image-2/` and a `website/` directory for project documentation. No files match the "beautiful-article" naming pattern.

### How would a beautiful-article skill theoretically transform a URL into HTML?

It would follow a pipeline: fetch the URL content using HTTP clients like `axios`, parse the HTML with tools like `jsdom` or `cheerio` to extract the article body, sanitize the markup to remove scripts and ads, and inject the cleaned content into a semantic HTML template with applied CSS classes.

### Where should the beautiful-article skill be located if it were added to the repository?

Following the existing convention, it would reside in `skills/beautiful-article/`. The entry point would likely be [`skills/beautiful-article/index.js`](https://github.com/ConardLi/garden-skills/blob/main/skills/beautiful-article/index.js) (or [`main.py`](https://github.com/ConardLi/garden-skills/blob/main/main.py) for Python implementations), with supporting modules for parsing and templating stored in the same directory.

### Can I contribute a beautiful-article skill to the garden-skills project?

Yes. You can implement the fetch-parse-template workflow in a new `skills/beautiful-article/` directory. Ensure your implementation exports a function that accepts a URL string or document path and returns a sanitized HTML string, matching the async patterns used in `skills/gpt-image-2/`.