Skip to content

Commit a53163d

Browse files
committed
Update docs
1 parent abe6b2a commit a53163d

File tree

11 files changed

+725
-561
lines changed

11 files changed

+725
-561
lines changed

contributing.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

docs/Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
gem "jekyll-default-layout"

docs/_config.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
title: Proper Tags
2+
3+
description: Pure ESM fork of the popular package common-tags.
4+
5+
remote_theme: just-the-docs/just-the-docs
6+
7+
url: https://proper-tags.56k.guru
8+
9+
aux_links:
10+
GitHub Repository: https://github.com/hexagon/proper-tags
11+
NPM Library: https://npmjs.com/package/proper-tags
12+
Deno Library: https://deno.land/x/proper_tags
13+
14+
plugins:
15+
- jekyll-relative-links
16+
- jekyll-default-layout
17+
18+
# color_scheme: dark

docs/_includes/head_custom.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9224018205432249" crossorigin="anonymous"></script>

docs/contributing.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
layout: page
3+
title: "Contributing"
4+
nav_order: 4
5+
---
6+
7+
# Contribution Guidelines
8+
9+
---
10+
11+
Thank you for considering contributing to the `proper-tags` package! Here's a comprehensive guide to help you through the process.
12+
13+
## Setup
14+
15+
1. **Fork the Repository**: Use the GitHub interface to fork this repository to your account.
16+
2. **Clone the Fork**: On your local machine, open a terminal or command prompt. Use the following command to clone the forked repository:
17+
`git clone https://github.com/hexagon/proper-tags.git`
18+
3. **Navigate to the Repository**: Change to the project directory using:
19+
`cd proper-tags`
20+
4. **Install Dependencies**: To ensure you have all the required dependencies, run:
21+
`npm ci`
22+
23+
## Working on Your Contribution
24+
25+
1. **Create a New Branch**: Always create a new branch for your work to ensure master remains clean. Use:
26+
`git checkout -b feature/<feature-name>` or `git checkout -b bugfix/<bug-name>`
27+
2. **Stay Updated**: Ensure you regularly pull the latest changes from the upstream repository to keep your fork up-to-date:
28+
`git pull origin master`
29+
30+
## Tests
31+
32+
1. **Writing Tests**: Make sure you include tests that cover any new logic or features you add. A good test not only confirms the correct behavior but can also serve as documentation for how a certain feature works.
33+
2. **Running Tests**: This project uses [AVA](https://github.com/sindresorhus/ava) for testing. To run tests, execute:
34+
`npm test`
35+
3. **Testing Convention**: The project is set up to search for test files in the `src` directory that have the `.test.js` extension.
36+
37+
## Code Style and Quality
38+
39+
1. **Coding Standards**: Adhere to the code style and patterns established in the project. This ensures consistency and readability across all contributions.
40+
2. **Linting**: The project uses [Prettier](https://github.com/prettier/prettier) and [ESLint](https://github.com/eslint/eslint) to maintain a consistent code style. Before committing your changes, ensure your code adheres to the rules. Run:
41+
`npm run lint`
42+
3. **Auto-fixing Issues**: Some linting issues can be automatically fixed. Use the following command to attempt auto-fixes:
43+
`npm run lint:fix`
44+
45+
## Committing and Pushing Changes
46+
47+
1. **Commit Messages**: Write clear and concise commit messages describing the changes you made.
48+
2. **Atomic Commits**: Make sure each commit contains related changes. Avoid bundling unrelated changes into a single commit.
49+
3. **Push Your Changes**: Once you're ready to submit your changes, push the branch to your forked repository:
50+
`git push origin feature/<feature-name>`
51+
52+
## Submitting a Pull Request
53+
54+
1. **Open a Pull Request**: Navigate to the GitHub page of your forked repository and click on the "New pull request" button.
55+
2. **Describe Your Changes**: In the pull request description, provide a detailed explanation of the changes you've made. If your PR is fixing a bug, provide steps to reproduce the bug.
56+
3. **Wait for Review**: Maintainers of the `proper-tags` package will review your pull request. Address any feedback or changes requested.
57+
58+
## Final Notes
59+
60+
- Please ensure your code doesn't introduce any regressions by running the full test suite before submitting a PR.
61+
- Always reference relevant issues or discussions in your pull requests.
62+
- Contributions aren't just about code! If you find a typo, a confusing piece of documentation, or have ideas for improving the project structure, we'd love to hear from you.
63+
64+
Thank you for helping improve `proper-tags`!
65+
```

docs/index.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
layout: page
3+
title: "Overview"
4+
nav_order: 1
5+
---
6+
7+
# proper-tags Documentation
8+
9+
---
10+
11+
**proper-tags** is an evolved version of the widely-used CommonJS package **common-tags**. It has been updated with the following considerations for modern JavaScript environments:
12+
13+
🌟 Extendable: proper-tags comes with built-in tools for creating custom tags.
14+
📦 ESM Code Base: With support for ESM/ECMAScript Modules, it ensures native compatibility with modern development tools.
15+
🦕 Deno Compatibility: Designed specifically to function seamlessly with the Deno runtime.
16+
📝 TypeScript Definitions: Integrated TypeScript typings make development in TypeScript a breeze.
17+
🔄 API Consistency: Its interface aligns with common-tags, ensuring compatibility with existing frameworks and guides.
18+
19+
## Sample Usage
20+
21+
```js
22+
import { html } from 'proper-tags';
23+
24+
html`
25+
<div id="user-card">
26+
<h2>${user.name}</h2>
27+
</div>
28+
```
29+

docs/installation.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
layout: page
3+
title: "Installation"
4+
nav_order: 2
5+
---
6+
7+
# Installation
8+
9+
---
10+
11+
## Node
12+
13+
**Install**
14+
15+
npm install proper-tags
16+
17+
**ESM Import**
18+
19+
import { stripIndent } from 'proper-tags';
20+
21+
**Legacy CommonJS Require**
22+
23+
const { stripIndent } = require('proper-tags');
24+
25+
## Deno
26+
27+
To use `proper-tags` with **Deno**, follow the import example:
28+
29+
import { html } from 'https://deno.land/x/proper_tags/dist/proper-tags.js';
30+
31+
> **Note:** Make sure to freeze the url to a specific version
32+
33+
## CDN/Browser
34+
35+
For usage via **jsdelivr** in the browser:
36+
37+
<script src="https://cdn.jsdelivr.net/npm/proper-tags@2.0.0-beta.0/dist/proper-tags.umd.js"></script>
38+
39+
> **Note:** Ensure you're using the latest version in the URL.

0 commit comments

Comments
 (0)