thibaud frere commited on
Commit ·
f9074bc
1
Parent(s): 2dbf974
update doc
Browse filesFiles changed (9)
- app/.astro/astro/content.d.ts-231
- app/package.json
- app/scripts/export-pdf.mjs+14-3
- app/src/content/chapters/components.mdx+2
- app/src/content/chapters/markdown.mdx+42-11
- app/src/content/chapters/writing-your-content.mdx+3-3
- app/src/content/embeds/color-picker.html → app/src/content/embeds/demo/color-picker.htmlRenamed
- app/src/content/embeds/content-structure.html → app/src/content/embeds/demo/content-structure.htmlRenamed
- app/src/content/embeds/palettes.html → app/src/content/embeds/demo/palettes.htmlRenamed
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231declare module 'astro:content' {interface Render {'.mdx': Promise<{Content: import('astro').MarkdownInstance<{}>['Content'];headings: import('astro').MarkdownHeading[];remarkPluginFrontmatter: Record<string, any>;components: import('astro').MDXInstance<{}>['components'];}>;}}declare module 'astro:content' {interface RenderResult {Content: import('astro/runtime/server/index.js').AstroComponentFactory;headings: import('astro').MarkdownHeading[];remarkPluginFrontmatter: Record<string, any>;}interface Render {'.md': Promise<RenderResult>;}export interface RenderedContent {html: string;metadata?: {imagePaths: Array<string>;[key: string]: unknown;};}}declare module 'astro:content' {type Flatten<T> = T extends { [K: string]: infer U } ? U : never;export type CollectionKey = keyof AnyEntryMap;export type CollectionEntry<C extends CollectionKey> = Flatten<AnyEntryMap[C]>;export type ContentCollectionKey = keyof ContentEntryMap;export type DataCollectionKey = keyof DataEntryMap;type AllValuesOf<T> = T extends any ? T[keyof T] : never;type ValidContentEntrySlug<C extends keyof ContentEntryMap> = AllValuesOf<ContentEntryMap[C]>['slug'];/** @deprecated Use `getEntry` instead. */export function getEntryBySlug<C extends keyof ContentEntryMap,E extends ValidContentEntrySlug<C> | (string & {}),>(collection: C,// Note that this has to accept a regular string too, for SSRentrySlug: E,): E extends ValidContentEntrySlug<C>? Promise<CollectionEntry<C>>: Promise<CollectionEntry<C> | undefined>;/** @deprecated Use `getEntry` instead. */export function getDataEntryById<C extends keyof DataEntryMap, E extends keyof DataEntryMap[C]>(collection: C,entryId: E,): Promise<CollectionEntry<C>>;export function getCollection<C extends keyof AnyEntryMap, E extends CollectionEntry<C>>(collection: C,filter?: (entry: CollectionEntry<C>) => entry is E,): Promise<E[]>;export function getCollection<C extends keyof AnyEntryMap>(collection: C,filter?: (entry: CollectionEntry<C>) => unknown,): Promise<CollectionEntry<C>[]>;export function getEntry<C extends keyof ContentEntryMap,E extends ValidContentEntrySlug<C> | (string & {}),>(entry: {collection: C;slug: E;}): E extends ValidContentEntrySlug<C>? Promise<CollectionEntry<C>>: Promise<CollectionEntry<C> | undefined>;export function getEntry<C extends keyof DataEntryMap,E extends keyof DataEntryMap[C] | (string & {}),>(entry: {collection: C;id: E;}): E extends keyof DataEntryMap[C]? Promise<DataEntryMap[C][E]>: Promise<CollectionEntry<C> | undefined>;export function getEntry<C extends keyof ContentEntryMap,E extends ValidContentEntrySlug<C> | (string & {}),>(collection: C,slug: E,): E extends ValidContentEntrySlug<C>? Promise<CollectionEntry<C>>: Promise<CollectionEntry<C> | undefined>;export function getEntry<C extends keyof DataEntryMap,E extends keyof DataEntryMap[C] | (string & {}),>(collection: C,id: E,): E extends keyof DataEntryMap[C]? Promise<DataEntryMap[C][E]>: Promise<CollectionEntry<C> | undefined>;/** Resolve an array of entry references from the same collection */export function getEntries<C extends keyof ContentEntryMap>(entries: {collection: C;slug: ValidContentEntrySlug<C>;}[],): Promise<CollectionEntry<C>[]>;export function getEntries<C extends keyof DataEntryMap>(entries: {collection: C;id: keyof DataEntryMap[C];}[],): Promise<CollectionEntry<C>[]>;export function render<C extends keyof AnyEntryMap>(entry: AnyEntryMap[C][string],): Promise<RenderResult>;export function reference<C extends keyof AnyEntryMap>(collection: C,): import('astro/zod').ZodEffects<import('astro/zod').ZodString,C extends keyof ContentEntryMap? {collection: C;slug: ValidContentEntrySlug<C>;}: {collection: C;id: keyof DataEntryMap[C];}>;// Allow generic `string` to avoid excessive type errors in the config// if `dev` is not running to update as you edit.// Invalid collection names will be caught at build time.export function reference<C extends string>(collection: C,): import('astro/zod').ZodEffects<import('astro/zod').ZodString, never>;type ReturnTypeOrOriginal<T> = T extends (...args: any[]) => infer R ? R : T;type InferEntrySchema<C extends keyof AnyEntryMap> = import('astro/zod').infer<ReturnTypeOrOriginal<Required<ContentConfig['collections'][C]>['schema']>>;type ContentEntryMap = {"chapters": {"best-pratices.mdx": {id: "best-pratices.mdx";slug: "best-pratices";body: string;collection: "chapters";data: any} & { render(): Render[".mdx"] };"components.mdx": {id: "components.mdx";slug: "components";body: string;collection: "chapters";data: any} & { render(): Render[".mdx"] };"debug-components.mdx": {id: "debug-components.mdx";slug: "debug-components";body: string;collection: "chapters";data: any} & { render(): Render[".mdx"] };"getting-started.mdx": {id: "getting-started.mdx";slug: "getting-started";body: string;collection: "chapters";data: any} & { render(): Render[".mdx"] };"introduction.mdx": {id: "introduction.mdx";slug: "introduction";body: string;collection: "chapters";data: any} & { render(): Render[".mdx"] };"markdown.mdx": {id: "markdown.mdx";slug: "markdown";body: string;collection: "chapters";data: any} & { render(): Render[".mdx"] };"writing-your-content.mdx": {id: "writing-your-content.mdx";slug: "writing-your-content";body: string;collection: "chapters";data: any} & { render(): Render[".mdx"] };};"embeds": {"vibe-code-d3-embeds-directives.md": {id: "vibe-code-d3-embeds-directives.md";slug: "vibe-code-d3-embeds-directives";body: string;collection: "embeds";data: any} & { render(): Render[".md"] };};};type DataEntryMap = {"assets": {"data/mnist-variant-model": {id: "data/mnist-variant-model";collection: "assets";data: any};};};type AnyEntryMap = ContentEntryMap & DataEntryMap;export type ContentConfig = never;}
167 unmodified lines168169170171172173174175237 unmodified lines413414415416417418419167 unmodified lines// filename can be provided, else computed from DOM (button) or page title laterlet outFileBase = (args.filename && String(args.filename).replace(/\.pdf$/i, '')) || 'article';console.log('> Building Astro site…');await run('npm', ['run', 'build']);console.log('> Starting Astro preview…');// Start preview in its own process group so we can terminate all children reliably237 unmodified lines/* Banner centering & visibility */.hero .points { mix-blend-mode: normal !important; }.d3-galaxy { width: 100% !important; height: 300px; max-width: 980px !important; margin-left: auto !important; margin-right: auto !important; }.d3-galaxy svg { background: var(--surface-bg); width: 100% !important; height: auto !important; }` });} catch {}await page.pdf({167 unmodified lines168169170171172173174175176177178179180181182183184185186237 unmodified lines424425426427428429430167 unmodified lines// filename can be provided, else computed from DOM (button) or page title laterlet outFileBase = (args.filename && String(args.filename).replace(/\.pdf$/i, '')) || 'article';// Build only if dist/ does not existconst distDir = resolve(cwd, 'dist');let hasDist = false;try {const st = await fs.stat(distDir);hasDist = st && st.isDirectory();} catch {}if (!hasDist) {console.log('> Building Astro site…');await run('npm', ['run', 'build']);} else {console.log('> Skipping build (dist/ exists)…');}console.log('> Starting Astro preview…');// Start preview in its own process group so we can terminate all children reliably237 unmodified lines/* Banner centering & visibility */.hero .points { mix-blend-mode: normal !important; }.d3-galaxy { width: 100% !important; height: 300px; max-width: 980px !important; margin-left: auto !important; margin-right: auto !important; }.d3-galaxy svg { width: 100% !important; height: auto !important; }` });} catch {}await page.pdf({
33 unmodified lines34353637383940414243444533 unmodified lines| `downloadable` | No | Adds a download button to fetch the image file.| `loading="lazy"` | No | Lazy loads the image.| `caption` | No | Adds a caption and credit.<ResponsiveImagesrc={placeholder}zoomabledownloadablelayout="fixed"alt="A placeholder image alt text"caption={'A placeholder image description <span class="image-credit">From the <a target="_blank" href="https://commons.wikimedia.org/wiki/File:RCA_Indian_Head_Test_Pattern.svg">RCA Indian Head Test Pattern</a></span>'}33 unmodified lines343536373839404142434445464733 unmodified lines| `downloadable` | No | Adds a download button to fetch the image file.| `loading="lazy"` | No | Lazy loads the image.| `caption` | No | Adds a caption and credit.| `id` | No | Adds an `id` to the outer figure for deep-linking and cross-references.<ResponsiveImagesrc={placeholder}zoomabledownloadableid="placeholder-image"layout="fixed"alt="A placeholder image alt text"caption={'A placeholder image description <span class="image-credit">From the <a target="_blank" href="https://commons.wikimedia.org/wiki/File:RCA_Indian_Head_Test_Pattern.svg">RCA Indian Head Test Pattern</a></span>'}
15 unmodified lines16171819202122232 unmodified lines2627282930313231 unmodified lines64656667686970717215 unmodified lines88899091929394959623 unmodified lines1201211221231241251261271285 unmodified lines13413513613713813914014 unmodified lines15515615715815916016115 unmodified lines<div className="button-group"><a className="button" href="#math">Math</a><a className="button" href="#code-blocks">Code</a><a className="button" href="#citations-and-notes">Citations</a><a className="button" href="#footnotes">Footnotes</a><a className="button" href="#mermaid-diagrams">Mermaid</a><a className="button" href="#separator">Separator</a><a className="button" href="#table">Table</a>2 unmodified lines### MathKaTeX is used for math rendering. You can use inline notation `$...$` inline or block `$$...$$` notation. This is an inline math equation: $x^2 + y^2 = z^2$.$$\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\left(\frac{QK^\top}{\sqrt{d_k}}\right) V31 unmodified lines````</Accordion>### Citations**Citations** use the `@` syntax (e.g., `[@vaswani2017attention]` or `@vaswani2017attention` in narrative form) and are **automatically** collected to render the **bibliography** at the end of the article. The citation keys come from `app/src/content/bibliography.bib`.1) In-text citation with brackets: [@vaswani2017attention].15 unmodified lines```</Accordion>### Footnotes**Footnotes** use an identifier like `[^f1]` and a definition anywhere in the document, e.g., `[^f1]: Your explanation`. They are **numbered** and **listed automatically** at the end of the article.1) Footnote attached to the sentence above[^f1].23 unmodified lines```Result: `add(2, 3) === 5`.4) Footnote that includes citations inside[^f5] and another footnote[^f1].[^f5]: Footnote containing citations [@vaswani2017attention] and [@kingma2015adam].<Accordion title="Code example">```mdx5 unmodified lines3) Footnote with an inline code and an indented code block[^f4].4) Footnote that includes citations inside[^f5].[^f1]: Footnote attached to the sentence above.14 unmodified linesResult: `add(2, 3) === 5`.[^f5]: Footnote containing citations [@vaswani2017attention] and [@kingma2015adam].```</Accordion>15 unmodified lines16171819202122232 unmodified lines2627282930313231 unmodified lines6465666768697071727374757615 unmodified lines929394959697989910023 unmodified lines1241251261271281291301311325 unmodified lines13813914014114214314414 unmodified lines15916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119215 unmodified lines<div className="button-group"><a className="button" href="#math">Math</a><a className="button" href="#code-blocks">Code</a><a className="button" href="#citation-and-notes">Citation</a><a className="button" href="#footnote">Footnote</a><a className="button" href="#mermaid-diagrams">Mermaid</a><a className="button" href="#separator">Separator</a><a className="button" href="#table">Table</a>2 unmodified lines### MathKaTeX is used for math rendering. You can use **inline** notation `$...$` or **block** `$$...$$` notation. As an example, this is an **inline** math equation: $x^2 + y^2 = z^2$ and this is a **block**:$$\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\left(\frac{QK^\top}{\sqrt{d_k}}\right) V31 unmodified lines````</Accordion>### CitationThe **citation keys** come from `app/src/content/bibliography.bib`.**Citation** use the `@` syntax (e.g., `[@vaswani2017attention]` or `@vaswani2017attention` in narrative form) and are **automatically** collected to render the **bibliography** at the end of the article.<Note variant="info" emoji="💡">Multiple citations to the same citation key are automatically merged into a single citation.</Note>1) In-text citation with brackets: [@vaswani2017attention].15 unmodified lines```</Accordion>### Footnote**Footnote** use an identifier like `[^f1]` and a definition anywhere in the document, e.g., `[^f1]: Your explanation`. They are **numbered** and **listed automatically** at the end of the article.1) Footnote attached to the sentence above[^f1].23 unmodified lines```Result: `add(2, 3) === 5`.4) Footnote that includes citation inside[^f5] and another footnote[^f1].[^f5]: Footnote containing citation [@vaswani2017attention] and [@kingma2015adam].<Accordion title="Code example">```mdx5 unmodified lines3) Footnote with an inline code and an indented code block[^f4].4) Footnote that includes citation inside[^f5].[^f1]: Footnote attached to the sentence above.14 unmodified linesResult: `add(2, 3) === 5`.[^f5]: Footnote containing citation [@vaswani2017attention] and [@kingma2015adam].```</Accordion>### ReferenceIn research articles, you may have to make references to anything. They are basically html anchors. They can be used internally in the article or externally in other articles.1. **Title**<br/>Each title is automatically generated with a slugged version from the citation key. ( slugged title from the citation key )like for example, the id `#mermaid-diagrams` is generated from the `Mermaid diagrams` title.<br/><br/>**Example** [Mermaid diagrams](#mermaid-diagram)2. **Image and chart**<br/>You can make a link to an image or a chart by adding an ID on it.<br/>`<HtmlEmbed id="neural-network-mnist-like"/>` then you can link to it with a link like `<a href="#neural-network-mnist-like">Fig 1</a>`.<br/><br/>**Example** [Chart 1](#neural-network-mnist-like) or [Fig 1](#placeholder-image)<Accordion title="Code example">```mdx#### Mermaid diagrams[Mermaid diagrams](#mermaid-diagrams)<HtmlEmbed id="neural-network-mnist-like"/>[Chart 1](#neural-network-mnist-like)<ResponsiveImage id="placeholder-image" src="..."/>[Fig 1](#placeholder-image)```</Accordion>
16 unmodified lines17181920212223106 unmodified lines1301311321331341351366 unmodified lines14314414514614714814916 unmodified linesYour **article** lives in **one and unique place**. The `content` folder.<HtmlEmbed frameless src="content-structure.html" />### Article.mdx106 unmodified lines#### Brand color<Sidenote><HtmlEmbed frameless src="color-picker.html" /><Fragment slot="aside">You can use the color picker to select the right color.6 unmodified linesHere is a suggestion of **color palettes** for your **data visualizations** that align with your **brand identity**. These palettes are generated from your `--primary-color`.<HtmlEmbed frameless src="palettes.html" /><br/>**Use color with care.**Color should rarely be the only channel of meaning.16 unmodified lines17181920212223106 unmodified lines1301311321331341351366 unmodified lines14314414514614714814916 unmodified linesYour **article** lives in **one and unique place**. The `content` folder.<HtmlEmbed frameless src="demo/content-structure.html" />### Article.mdx106 unmodified lines#### Brand color<Sidenote><HtmlEmbed frameless src="demo/color-picker.html" /><Fragment slot="aside">You can use the color picker to select the right color.6 unmodified linesHere is a suggestion of **color palettes** for your **data visualizations** that align with your **brand identity**. These palettes are generated from your `--primary-color`.<HtmlEmbed frameless src="demo/palettes.html" /><br/>**Use color with care.**Color should rarely be the only channel of meaning.
app/.astro/astro/content.d.ts-231
app/package.json
app/scripts/export-pdf.mjs+14-3
app/src/content/chapters/components.mdx+2
app/src/content/chapters/markdown.mdx+42-11
app/src/content/chapters/writing-your-content.mdx+3-3
app/src/content/embeds/color-picker.html → app/src/content/embeds/demo/color-picker.htmlRenamed
app/src/content/embeds/content-structure.html → app/src/content/embeds/demo/content-structure.htmlRenamed
app/src/content/embeds/palettes.html → app/src/content/embeds/demo/palettes.htmlRenamed