Skip to content

Commit 9542f89

Browse files
committed
docs: add comprehensive v0.4.0 documentation
- Add deployment modes guide for SSR vs client configuration - Add testing documentation (unit, integration, e2e) - Add system and processing architecture documentation - Update all examples to use correct package name (@mitre/nuxt-smartscript) - Document actual plugin API (processAll, processElement, refresh, destroy) - Remove references to non-existent useSmartScript composable - Update configuration from 'symbols' to 'transformations' Authored by: Aaron Lippold<lippold@gmail.com>
1 parent fdcd25a commit 9542f89

17 files changed

+3637
-1086
lines changed

docs/api/composables.md

Lines changed: 200 additions & 340 deletions
Large diffs are not rendered by default.

docs/api/configuration.md

Lines changed: 21 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ export default defineNuxtConfig({
1212
// Enable/disable the plugin
1313
enabled: true,
1414

15+
// SSR/SSG configuration (v0.4.0+)
16+
ssr: true, // Enable server-side rendering
17+
client: true, // Enable client-side processing
18+
1519
// Customize positioning (in em units)
1620
positioning: {
1721
trademark: {
@@ -231,56 +235,29 @@ The plugin uses the following default CSS classes:
231235
| Ordinal | `ss-sup` | `ss-ordinal` | Ordinal numbers (1st, 2nd, etc.) |
232236
| Math | `ss-sup` or `ss-sub` | `ss-math` | Math notation (x^2, x_1) |
233237

234-
### Custom Class Names
235-
236-
You can customize the CSS class names used by the plugin in your `nuxt.config.ts`:
237-
238-
```typescript
239-
export default defineNuxtConfig({
240-
smartscript: {
241-
cssClasses: {
242-
superscript: 'my-sup',
243-
subscript: 'my-sub',
244-
trademark: 'tm-mark',
245-
registered: 'reg-mark',
246-
ordinal: 'ord-num',
247-
math: 'math-notation'
248-
}
249-
}
250-
})
251-
```
238+
### Working with CSS Classes
252239

253-
When using custom classes, remember to update your CSS accordingly:
240+
The default CSS classes can be targeted in your stylesheets:
254241

255242
```css
256-
/* Custom styles for your custom classes */
257-
sup.my-sup {
258-
vertical-align: super;
259-
font-size: 0.75em;
260-
}
261-
262-
sup.my-sup.tm-mark {
263-
/* Trademark specific styles */
264-
}
265-
266-
sub.my-sub {
267-
vertical-align: sub;
268-
font-size: 0.75em;
269-
}
243+
/* Target specific element types */
244+
.ss-sup.ss-tm { /* Trademark symbols */ }
245+
.ss-sup.ss-reg { /* Registered symbols */ }
246+
.ss-sup.ss-ordinal { /* Ordinal numbers */ }
247+
.ss-sup.ss-math { /* Math superscripts */ }
248+
.ss-sub.ss-math { /* Math subscripts */ }
249+
.ss-sub { /* Chemical formulas and subscripts */ }
270250
```
271251

272-
### Accessing CSS Classes in Code
252+
### Finding Elements in JavaScript
273253

274-
```typescript
275-
import { CSS_CLASSES } from '@mitre/nuxt-smartscript'
276-
277-
// These will reflect your custom classes if configured
278-
console.log(CSS_CLASSES.superscript) // 'my-sup' (or 'ss-sup' if not customized)
279-
console.log(CSS_CLASSES.subscript) // 'my-sub' (or 'ss-sub' if not customized)
280-
console.log(CSS_CLASSES.trademark) // 'tm-mark' (or 'ss-tm' if not customized)
281-
console.log(CSS_CLASSES.registered) // 'reg-mark' (or 'ss-reg' if not customized)
282-
console.log(CSS_CLASSES.ordinal) // 'ord-num' (or 'ss-ordinal' if not customized)
283-
console.log(CSS_CLASSES.math) // 'math-notation' (or 'ss-math' if not customized)
254+
```javascript
255+
// Find all transformed elements
256+
const trademarks = document.querySelectorAll('.ss-tm')
257+
const registered = document.querySelectorAll('.ss-reg')
258+
const ordinals = document.querySelectorAll('.ss-ordinal')
259+
const mathElements = document.querySelectorAll('.ss-math')
260+
const subscripts = document.querySelectorAll('.ss-sub')
284261
```
285262

286263
## CSS Customization

0 commit comments

Comments
 (0)