Skip to content

Commit 563fbb3

Browse files
committed
deploy: 3d14f55
0 parents  commit 563fbb3

215 files changed

Lines changed: 205583 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.nojekyll

Whitespace-only changes.

Dockerfile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM mcr.microsoft.com/dotnet/sdk:7.0
2+
3+
RUN apt-get update \
4+
&& apt-get -y upgrade \
5+
&& apt-get -y install python3 python3-pip python3-dev ipython3
6+
7+
RUN python3 -m pip install --no-cache-dir notebook jupyterlab
8+
9+
ARG NB_USER=fsdocs-user
10+
ARG NB_UID=1000
11+
ENV USER ${NB_USER}
12+
ENV NB_UID ${NB_UID}
13+
ENV HOME /home/${NB_USER}
14+
15+
RUN adduser --disabled-password \
16+
--gecos "Default user" \
17+
--uid ${NB_UID} \
18+
${NB_USER}
19+
20+
COPY . ${HOME}
21+
USER root
22+
RUN chown -R ${NB_UID} ${HOME}
23+
USER ${NB_USER}
24+
25+
ENV PATH="${PATH}:$HOME/.dotnet/tools/"
26+
27+
RUN dotnet tool install --global Microsoft.dotnet-interactive --version 1.0.410202
28+
29+
RUN dotnet-interactive jupyter install

NuGet.config

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<solution>
4+
<add key="disableSourceControlIntegration" value="true" />
5+
</solution>
6+
<packageSources>
7+
<clear />
8+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
9+
<add key="dotnet3-dev" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1/nuget/v3/index.json" />
10+
<add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
11+
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
12+
<add key="PSGallery" value="https://www.powershellgallery.com/api/v2/" />
13+
</packageSources>
14+
</configuration>

content/fsdocs-copy-button.js

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
// Adds a "Copy" button to every code block so readers can easily copy snippets.
2+
function createCopyButton() {
3+
const button = document.createElement('button')
4+
button.className = 'copy-code-button'
5+
button.setAttribute('aria-label', 'Copy code to clipboard')
6+
button.textContent = 'Copy'
7+
return button
8+
}
9+
10+
function attachCopyHandler(button, getText) {
11+
button.addEventListener('click', function () {
12+
const text = getText()
13+
if (navigator.clipboard && navigator.clipboard.writeText) {
14+
navigator.clipboard.writeText(text).then(
15+
function () {
16+
button.textContent = 'Copied!'
17+
setTimeout(function () {
18+
button.textContent = 'Copy'
19+
}, 2000)
20+
},
21+
function () {
22+
button.textContent = 'Failed'
23+
setTimeout(function () {
24+
button.textContent = 'Copy'
25+
}, 2000)
26+
}
27+
)
28+
} else {
29+
// Fallback for non-HTTPS environments
30+
const el = document.createElement('textarea')
31+
el.value = text
32+
document.body.appendChild(el)
33+
el.select()
34+
document.execCommand('copy')
35+
document.body.removeChild(el)
36+
button.textContent = 'Copied!'
37+
setTimeout(function () {
38+
button.textContent = 'Copy'
39+
}, 2000)
40+
}
41+
})
42+
}
43+
44+
document.addEventListener('DOMContentLoaded', function () {
45+
// table.pre blocks (F# highlighted code, sometimes with line numbers)
46+
document.querySelectorAll('table.pre').forEach(function (table) {
47+
const wrapper = document.createElement('div')
48+
wrapper.className = 'code-block-wrapper'
49+
table.parentNode.insertBefore(wrapper, table)
50+
wrapper.appendChild(table)
51+
52+
const button = createCopyButton()
53+
wrapper.appendChild(button)
54+
55+
const snippet = table.querySelector('.snippet pre')
56+
attachCopyHandler(button, function () {
57+
return (snippet || table).innerText
58+
})
59+
})
60+
61+
// Standard pre > code blocks (Markdown fenced code, standalone fssnip, etc.)
62+
// Skip those already handled inside table.pre above.
63+
document.querySelectorAll('pre > code').forEach(function (code) {
64+
if (code.closest('table.pre')) return
65+
const pre = code.parentElement
66+
pre.classList.add('has-copy-button')
67+
68+
const button = createCopyButton()
69+
pre.appendChild(button)
70+
71+
attachCopyHandler(button, function () {
72+
return code.innerText
73+
})
74+
})
75+
})

0 commit comments

Comments
 (0)