Skip to content

Commit

Permalink
chore: write changelog before release
Browse files Browse the repository at this point in the history
  • Loading branch information
louiss0 committed Jan 2, 2025
1 parent 8768b2c commit 513cd0c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 4 deletions.
41 changes: 41 additions & 0 deletions packages/asciidoc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,47 @@ import { AsciidocConfigObject } from "@forastro/asciidoc"
} satisfies AsciidocConfigObject
```

### Styling

This plugin allows you to use Tailwind or UnoCSS to style your blog pages.
To use either use the `@forastro/asciidoc/plugins` module.

Tailwind

```ts
import { tailwindAsciidocTypography } from "@forastro/asciidoc/plugins"

export default {
plugins:[
tailwindAsciidocTypography
]
}
```

Uno

```ts
import { presetAsciidocTypography } from "@forastro/asciidoc/plugins"

export default {
plugins:[
presetAsciidocTypography()
]
}
```

When using For astro Asciidoc **only shiki and prisma are supported** for syntax highlighting.
This is what Astro does so I decided to follow that.

To configure a syntax highlighter you must. Create a `asciidoc.config.m{js,ts}` file.
Inside of it use the `attributes.sourceHighlighter` prop to specify what highlighter you want to use.
For **Shiki** the only thing you can do is customize the theme nothing else.
When it comes to **Prism** you must use your own stylesheet for the theme there's nothing else that can be done.

By default Shiki is used with the **light theme as github-dark** and the **dark theme being github-light**.
This is made under the assumption that **under light pages the code can be seen clearly** but **under darkness
light can shine through**.

## Contributions

If you want to file issues or make a contribution go to the [For Astro Repo](https://github.com/louiss0/forastro).
Expand Down
6 changes: 2 additions & 4 deletions packages/asciidoc/src/lib/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ const preflights = {
...CSS_UtilitiesClasses,
};

export const presetAdocTypograhy = definePreset(() => {
export const presetAsciidocTypography = definePreset(() => {
const TYPOGRAPHY_SELECTOR_NAME = 'prose';
const typographySelectorNameRE = new RegExp(`^${TYPOGRAPHY_SELECTOR_NAME}$`);
const selectorColorRE = new RegExp(`^${TYPOGRAPHY_SELECTOR_NAME}-([a-z-]+)$`);
Expand Down Expand Up @@ -663,9 +663,7 @@ export function getCSSWithSelectorName(typographySelectorName: string) {
}



// TODO: Work on this plugin
export const tailwindAsciidocProsePlugin = plugin(({ addBase, addComponents, addUtilities, }) => {
export const tailwindAsciidocTypography = plugin(({ addBase, addComponents, addUtilities, }) => {


const TYPOGRAPHY_SELECTOR_NAME = 'prose';
Expand Down

0 comments on commit 513cd0c

Please sign in to comment.