Skip to content

Commit

Permalink
update paths
Browse files Browse the repository at this point in the history
  • Loading branch information
sransara committed Jul 13, 2024
1 parent 4ddfd1e commit 02f1e89
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 12 deletions.
6 changes: 3 additions & 3 deletions adocx/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import path from 'node:path';
// @ts-ignore: Types are not available
import { register as krokiPluginRegisterHandle } from 'asciidoctor-kroki';

import { register as inlineMacroCalloutRegisterHandle } from './extensions/inlineMacroCallout';
import { register as inlineMacroCalloutRegisterHandle } from '#adocx/extensions/inlineMacroCallout';
import {
type AdocNodeConverters,
register as nodeConvertingConverterRegisterHandle,
} from './nodeConvertingConverter';
} from '#adocx/nodeConvertingConverter';

const nodeConverters = Object.fromEntries(
Object.entries(import.meta.glob('./nodeConverters/*.ts', { eager: true, import: 'convert' })).map(
Expand Down Expand Up @@ -60,7 +60,7 @@ export const asciidoctorConfig = {
icons: 'font',
stem: 'latexmath',
toc: 'macro',
imagesdir: './_assets/',
imagesdir: './_assets',
'kroki-fetch-diagram': true,
'kroki-default-format': 'png',
},
Expand Down
3 changes: 1 addition & 2 deletions adocx/extensions/inlineMacroCallout.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { Extensions } from 'asciidoctor';

import { isExtensionRegistrySingleton } from '@sransara/astro-adocx/utils/extension';
import type { Extensions } from 'asciidoctor';

export function register(registry: typeof Extensions | Extensions.Registry) {
if (isExtensionRegistrySingleton(registry)) {
Expand Down
5 changes: 3 additions & 2 deletions adocx/nodeConverters/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@

import { atag } from '@sransara/astro-adocx/utils/asx';
import type { Block, Inline } from 'asciidoctor';
import { type AdocNodeConverter } from '../nodeConvertingConverter';
import { convertImageNode } from './inline_image.js';

import { convertImageNode } from '#adocx/nodeConverters/inline_image.js';
import { type AdocNodeConverter } from '#adocx/nodeConvertingConverter';

export const convert: AdocNodeConverter<Block> = (node: Block, opts?: any) => {
const target = node.getAttribute('target');
Expand Down
3 changes: 2 additions & 1 deletion adocx/nodeConverters/inline_image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import { addOnceToAstroFence } from '@sransara/astro-adocx/utils/astroFence';
import { Aexpr, aexpr, atag } from '@sransara/astro-adocx/utils/asx';
import type { Inline } from 'asciidoctor';
import { type AdocNodeConverter } from '../nodeConvertingConverter';

import { type AdocNodeConverter } from '#adocx/nodeConvertingConverter';

export const convert: AdocNodeConverter<Inline> = (node: Inline, _opts?: any) => {
if (node.getType() === 'icon' && node.getDocument().getAttribute('icons') === 'font') {
Expand Down
3 changes: 2 additions & 1 deletion adocx/nodeConverters/inline_quoted.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { addOnceToAstroFence } from '@sransara/astro-adocx/utils/astroFence';
import type { Inline } from 'asciidoctor';
import { type AdocNodeConverter } from '../nodeConvertingConverter';

import { type AdocNodeConverter } from '#adocx/nodeConvertingConverter';

export const convert: AdocNodeConverter<Inline> = (node: Inline, _opts?: any) => {
const nodeType = node.getType();
Expand Down
3 changes: 2 additions & 1 deletion adocx/nodeConverters/listing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import { addOnceToAstroFence } from '@sransara/astro-adocx/utils/astroFence';
import { atag } from '@sransara/astro-adocx/utils/asx';
import type { Block } from 'asciidoctor';
import { type AdocNodeConverter } from '../nodeConvertingConverter';

import { type AdocNodeConverter } from '#adocx/nodeConvertingConverter';

export const convert: AdocNodeConverter<Block> = (node: Block, _opts?: any) => {
const id = node.getId();
Expand Down
3 changes: 2 additions & 1 deletion adocx/nodeConverters/stem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import { addOnceToAstroFence } from '@sransara/astro-adocx/utils/astroFence';
import { atag } from '@sransara/astro-adocx/utils/asx';
import type { Block } from 'asciidoctor';
import { type AdocNodeConverter } from '../nodeConvertingConverter';

import { type AdocNodeConverter } from '#adocx/nodeConvertingConverter';

export const convert: AdocNodeConverter<Block> = (node: Block, _opts?: any) => {
const id = node.getId();
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,8 @@
"tailwindcss": "^3.4.4",
"typescript": "^5.5.3",
"zod": "^3.23.8"
},
"imports": {
"#adocx/*": "./adocx/*"
}
}
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./*"]
"@/*": ["./*"],
"#adocx/*": ["./adocx/*"]
},
"checkJs": true,
"jsx": "preserve",
Expand Down

0 comments on commit 02f1e89

Please sign in to comment.