Skip to content

Commit

Permalink
Add id and ability to copy link of each section of spec
Browse files Browse the repository at this point in the history
  • Loading branch information
siddhantk232 committed Oct 14, 2024
1 parent 3811378 commit 4b5afc4
Show file tree
Hide file tree
Showing 7 changed files with 273 additions and 46 deletions.
100 changes: 99 additions & 1 deletion .fastn/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"package": "fast-nspec",
"package": "fastn-spec.fifthtry.site",
"all_packages": {
"app-switcher.fifthtry.site": {
"files": {
Expand Down Expand Up @@ -17282,6 +17282,32 @@
"zip_url": "https://fifthtry.com/ft2/api/site/download?site-slug=inter-typography",
"checksum": "61C43A01DEAA5B4540B9B6B843249881BB90D68C8BE5DE085BA1B2756A3D0D5F"
},
"lato-font.fifthtry.site": {
"files": {
"FASTN.ftd": {
"name": "FASTN.ftd",
"checksum": "0AF42D0A57EE4092A39EF1922E78181263FEA6216290E8CE9DE0AAD5748423EC",
"size": 5509
},
"README.md": {
"name": "README.md",
"checksum": "BC787B67F90323471FAFC4649BF27BC7A979EC84EF2704CA1F4883EA1EDE8DC5",
"size": 966
},
"custom.ftd": {
"name": "custom.ftd",
"checksum": "8161CE3D38D51321845491ECCF1B194A7E318BC1CF4F1BA0111F4D19C23731CA",
"size": 4996
},
"index.ftd": {
"name": "index.ftd",
"checksum": "23B8AE5012951E753E941D892B7BB74629310D714BFAED9A41B4F94DFC4C65C3",
"size": 2146
}
},
"zip_url": "https://fifthtry.com/ft2/api/site/download?site-slug=lato-font",
"checksum": "0DED0EDF55852E760A2C09E50EBBBE4508915A28E499DB2BA22649E6F4CAD45B"
},
"manrope-font.fifthtry.site": {
"files": {
"FASTN.ftd": {
Expand All @@ -17298,6 +17324,52 @@
"zip_url": "https://fifthtry.com/ft2/api/site/download?site-slug=manrope-font",
"checksum": "DAB07152B3198E530D4CADDA3DB98DD8CC10A324554EA1344D6BF9FCC2F85A3F"
},
"midnight-storm-typography.fifthtry.site": {
"files": {
"Changelog.md": {
"name": "Changelog.md",
"checksum": "3D8E5A54B51EC6632C7FDE92E3F413EB236290753673E8BF66AA4CD7A3B9A06F",
"size": 336
},
"FASTN.ftd": {
"name": "FASTN.ftd",
"checksum": "8402FCF8EFC13B9391729BC44FFA66B7A4E168DAC8A7609D3B8D9239B070BD68",
"size": 389
},
"LICENSE.md": {
"name": "LICENSE.md",
"checksum": "A95364C3842F2C439BD629F65E304A2850239B443596467254EE96E71CA213DD",
"size": 1498
},
"README.md": {
"name": "README.md",
"checksum": "7A5E46B6892D6A106463F03661BB7B7B64D8D4A5773733732B51ED26A090AF55",
"size": 1405
},
"fastn-typography.ftd": {
"name": "fastn-typography.ftd",
"checksum": "90C74114F286E69341572D40347FC483D6B7C4511C6CA41635A9A0D3CC10B72C",
"size": 8922
},
"index.ftd": {
"name": "index.ftd",
"checksum": "5EF2FC8842D30B5F911AD536E438E01398886EB3E25AB3550CB93848552B0F35",
"size": 13006
},
"static/midnight-strom-typography-dark-example.png": {
"name": "static/midnight-strom-typography-dark-example.png",
"checksum": "7A9C984A6BF29B53CEE2A6D298120CD0001ED789C6964EA2216F55AE75C93213",
"size": 90460
},
"static/midnight-strom-typography-example.png": {
"name": "static/midnight-strom-typography-example.png",
"checksum": "39EA8EF3A6125A0BEF45AA0E02E1E7AA58528D077F63AE5F5EEBFDB3BC8511A3",
"size": 88793
}
},
"zip_url": "https://fifthtry.com/ft2/api/site/download?site-slug=midnight-storm-typography",
"checksum": "5E96175CCE023A8F37DA15CF99D3CD8F848F0D117E93D5920E69E31A38F4D7C7"
},
"package-doc.fifthtry.site": {
"files": {
"FASTN.ftd": {
Expand Down Expand Up @@ -18566,6 +18638,32 @@
"zip_url": "https://fifthtry.com/ft2/api/site/download?site-slug=site-doc",
"checksum": "1D9A320B3585C780F8A1EAF4809C280BB8DDAC8CECCB0CC4041E4F15E07352BA"
},
"source-code-pro-font.fifthtry.site": {
"files": {
"FASTN.ftd": {
"name": "FASTN.ftd",
"checksum": "40B10C8BE03DFBFD10C8B84FFF848AB06635E04ADAFE3514B7D2F1CEBC4506CB",
"size": 29014
},
"README.md": {
"name": "README.md",
"checksum": "A7B1129859E44C42353835F88C1D828789EBBF91E0438235DA1402B6F858F7D5",
"size": 1045
},
"custom.ftd": {
"name": "custom.ftd",
"checksum": "828B9EF8A69F5297697EF3DBD91E04FD31B9D6F016561B9AA7B7820F37F3A5E6",
"size": 6991
},
"index.ftd": {
"name": "index.ftd",
"checksum": "3CA5A121F01529A6DCB689128B436ECA75A825832DD4E41A0DD66029793DB16A",
"size": 2483
}
},
"zip_url": "https://fifthtry.com/ft2/api/site/download?site-slug=source-code-pro-font",
"checksum": "0B291C3959F3B057B6EEDB6547E4D73034B1E85A47FF52AD3E2AA43FA228F3C4"
},
"svg-icons.fifthtry.site": {
"files": {
"FASTN.ftd": {
Expand Down
8 changes: 7 additions & 1 deletion FASTN.ftd
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
-- import: fastn

-- fastn.package: fast-nspec
-- fastn.package: fastn-spec.fifthtry.site

-- fastn.dependency: design-system.fifthtry.site
provided-via: fastn-spec.fifthtry.site/ds

-- fastn.dependency: dark-flame-cs.fifthtry.site
-- fastn.dependency: midnight-storm-typography.fifthtry.site
-- fastn.dependency: svg-icons.fifthtry.site


-- fastn.auto-import: design-system.fifthtry.site as ds
-- fastn.auto-import: fastn-spec.fifthtry.site/eds as eds
-- fastn.auto-import: fastn/processors as pr
15 changes: 15 additions & 0 deletions ds.ftd
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-- import: design-system.fifthtry.site
export: borders, button, icon-button, primary-button, toggle-image-link, secondary-button, circle-text-button, phosphor-icon-button, inline-row, footer-link, copyright-text, page-widths, header-link, page, heading-hero, heading-medium, heading-small, heading-tiny, copy-large, copy-regular, copy-small, fine-print, source-code, link, section-row, section-column, column, element-radius, radius, row, flush, gap, hv, spaces, border-data, border-bottom, alert, container, text-input, danger-button, checkbox, link-button, floater, copy-to-clipboard-text, copy-to-clipboard-icon, label-text, package-info, storybook, code, heading-large,
exposing: page-widths


-- page-widths widths:
regular.px: 1140
narrow.px: 800
wide.px: 1340

-- import: dark-flame-cs.fifthtry.site as dark-flame
-- import: midnight-storm-typography.fifthtry.site as typography

-- ftd.color-scheme colors: $dark-flame.main
-- ftd.type-data types: $typography.types
106 changes: 106 additions & 0 deletions eds.ftd
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
-- import: svg-icons.fifthtry.site/phosphor

-- string current-url:
$processor$: pr.current-url

-- component heading-large-id:
caption text:
string id:
optional ds.gap margin:
ftd.color color: $ds.colors.text-strong
optional string link:
ftd.text-style list style:
optional body content:
private string slug: $url(a = $heading-large-id.id)
private boolean $copied: false

-- ftd.column:

-- ftd.row:
id: $heading-large-id.id
align-content: left

-- phosphor.light: clipboard
size: 32
if: { !heading-large-id.copied }
$on-click$: $ftd.copy-to-clipboard(a = $heading-large-id.slug)
$on-click$: $ftd.set-bool($a = $heading-large-id.copied, v = true)

-- phosphor.light: clipboard-text
size: 32
if: { heading-large-id.copied }
$on-click$: $ftd.copy-to-clipboard(a = $heading-large-id.slug)
$on-click$: $ftd.set-bool($a = $heading-large-id.copied, v = false)


-- ds.heading-large: $heading-large-id.text
margin: $heading-large-id.margin
color: $heading-large-id.color
link: $heading-large-id.link
style: $heading-large-id.style


-- end: ftd.row

-- ds.copy-regular:
if: { heading-large-id.content }

$heading-large-id.content

-- end: ftd.column

-- end: heading-large-id

-- component heading-medium-id:
caption text:
string id:
optional ds.gap margin:
ftd.color color: $ds.colors.text-strong
optional string link:
ftd.text-style list style:
private string slug: $url(a = $heading-medium-id.id)
private boolean $copied: false
optional body content:

-- ftd.column:

-- ftd.row:
id: $heading-medium-id.id
align-content: left

-- phosphor.light: clipboard
size: 32
if: { !heading-medium-id.copied }
$on-click$: $ftd.copy-to-clipboard(a = $heading-medium-id.slug)
$on-click$: $ftd.set-bool($a = $heading-medium-id.copied, v = true)

-- phosphor.light: clipboard-text
size: 32
if: { heading-medium-id.copied }
$on-click$: $ftd.copy-to-clipboard(a = $heading-medium-id.slug)
$on-click$: $ftd.set-bool($a = $heading-medium-id.copied, v = false)


-- ds.heading-medium: $heading-medium-id.text
margin: $heading-medium-id.margin
color: $heading-medium-id.color
link: $heading-medium-id.link
style: $heading-medium-id.style

-- end: ftd.row

-- ds.copy-regular:
if: { heading-medium-id.content }

$heading-medium-id.content

-- end: ftd.column

-- end: heading-medium-id


-- string url(a):
string a:
string current_url: $current-url

"https://fastn-spec.fifthtry.site" + current_url + "#" + a
5 changes: 4 additions & 1 deletion index.ftd
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ Currently there is only [one implementation of
implementation can be derived using this spec.


-- ds.heading-large: Table of Contents
-- eds.heading-large-id: Table of Contents
id: table-of-contents

-- ds.copy-regular:

- [Overview](/overview/)
- [`ftd::p1` grammar](/p1/)
Expand Down
Loading

0 comments on commit 4b5afc4

Please sign in to comment.