Skip to content

Commit

Permalink
Merge branch 'main' into docs/document-how-to-setup-hf-oauth
Browse files Browse the repository at this point in the history
  • Loading branch information
sdiazlor authored Jul 5, 2024
2 parents c1c2414 + 1e6cb47 commit b997ab5
Show file tree
Hide file tree
Showing 81 changed files with 1,646 additions and 787 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/argilla-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@ on:
workflow_dispatch:

push:
branches:
- main
- develop
- releases/**

pull_request:
paths:
- "argilla-server/**"

jobs:
build:
Expand Down Expand Up @@ -109,6 +115,7 @@ jobs:
if: |
github.ref == 'refs/heads/main'
|| github.ref == 'refs/heads/develop'
|| contains(github.ref, 'releases/')
|| github.event_name == 'workflow_dispatch'
|| github.event_name == 'pull_request'
needs:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/argilla-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ on:
workflow_dispatch:

push:
branches:
- main
- develop
- releases/**

pull_request:
paths:
- "argilla-v1/**"

jobs:
build:
Expand Down
46 changes: 42 additions & 4 deletions .github/workflows/argilla.docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ on:

push:
tags:
- "v*"
- "v[2-9]+.[0-9]+.[0-9]+"
branches:
- "main"
- "develop"
- "docs/**"

defaults:
run:
Expand Down Expand Up @@ -54,13 +55,50 @@ jobs:
run: echo "${{ github.ref }}"
echo "${{ github.head_ref }}"

- run: |
- name: Deploy Argilla docs (branch /main)
run: |
pdm run mike deploy latest --push
pdm run mike set-default --push latest
if: github.ref == 'refs/heads/main'

- run: pdm run mike deploy dev --push
- name: Deploy Argilla docs (branch /develop)
run: pdm run mike deploy dev --push
if: github.ref == 'refs/heads/develop'

- run: pdm run mike deploy ${{ github.ref_name }}
- name: Deploy Argilla docs (release $version)
run: |
version=$(echo $TAG_VERSION | awk -F \. {'print $1"."$2'})
echo "Deploying version ${version}"
pdm run mike deploy $version --push
if: startsWith(github.ref, 'refs/tags/')
env:
TAG_VERSION: ${{ github.ref_name }}

- name: Delete Argilla docs (versions 'docs_*')
id: delete_deployment
run: |
versions=$(pdm run mike list)
formatted_versions=$(echo "$versions" | tr ',' '\n' | tr -d '[]')
for version in $versions; do
if [[ $version == docs_* ]]; then
echo "Deleting version: $version"
pdm run mike delete "$version" --push
fi
done
if: startsWith(github.ref, 'refs/tags/')

- name: Extract branch name
id: extract_branch_name
shell: bash
run: echo "branch_name=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" | sed 's/\//_/g' >> $GITHUB_OUTPUT

- name: Deploy Argilla docs (branch /docs/*)
run: pdm run mike deploy ${{ steps.extract_branch_name.outputs.branch_name }} --prop-set hidden=true --push
if: startsWith(github.ref, 'refs/heads/docs') || startsWith(github.head_ref, 'docs/')

- name: Add deployment message in PR
uses: mshick/add-pr-comment@v2
if: startsWith(github.ref, 'refs/heads/docs') || startsWith(github.head_ref, 'docs/')
with:
message: |
Docs for this PR have been deployed hidden from versioning: [https://argilla-io.github.io/argilla/${{ steps.extract_branch_name.outputs.branch_name }}](https://argilla-io.github.io/argilla/${{ steps.extract_branch_name.outputs.branch_name }})
8 changes: 8 additions & 0 deletions .github/workflows/argilla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ on:
workflow_dispatch:

push:
branches:
- main
- develop
- releases/**

pull_request:
paths:
- "argilla/**"

jobs:
build:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<template>
<div class="panel" :class="isExpanded ? '--expanded' : '--collapsed'">
<div
class="panel"
:class="[
isExpanded ? '--expanded' : '--collapsed',
hideOnDesktop ? '--mobile' : undefined,
]"
>
<BaseButton class="panel__header" @click="toggleExpand(isExpanded)">
<slot name="panelHeader" />
<svgicon
Expand All @@ -25,6 +31,10 @@ export default {
type: Boolean,
default: false,
},
hideOnDesktop: {
type: Boolean,
default: false,
},
},
methods: {
toggleExpand(value) {
Expand Down Expand Up @@ -72,4 +82,10 @@ export default {
@include font-size(13px);
}
}
.--mobile {
@include media(">=desktop") {
display: none !important;
}
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { marked } from "marked";
import { markedHighlight } from "marked-highlight";
import hljs from "highlight.js";
import * as DOMPurify from "dompurify";
import markedKatex from "marked-katex-extension";
const preprocess = (html) => {
return html.replace(/[^\S\r\n]+$/gm, "");
Expand All @@ -37,6 +38,12 @@ DOMPurify.addHook("beforeSanitizeAttributes", (node) => {
}
});
marked.use(
markedKatex({
throwOnError: false,
})
);
marked.use(
{ hooks: { preprocess, postprocess } },
markedHighlight({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ $resizable-bar-width: $base-space;
justify-content: space-between;
flex-direction: column;
height: 100%;
min-height: 0;
width: 100%;
&.--h-resizing {
user-select: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ $resizable-bar-width: $base-space;
display: flex;
justify-content: space-between;
height: 100%;
min-height: 0;
width: 100%;
&.--v-resizing {
user-select: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,9 @@ export class Highlighting {
}

const entityCssKey = this.styles.entityCssKey;
CSS.highlights.entries().forEach(([key]) => {
for (const [key] of CSS.highlights.entries()) {
if (key.startsWith(entityCssKey)) CSS.highlights.delete(key);
});
}

for (const [entity, selections] of Object.entries(highlights)) {
CSS.highlights.set(entity, new Highlight(...selections.flat()));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<span>
<span class="bulk__container">
<LoadLine v-if="isSubmitting || isDraftSaving || isDiscarding" />
<VerticalResizable
class="wrapper"
Expand Down Expand Up @@ -164,8 +164,8 @@
</HorizontalResizable>
</template>
<BaseCollapsablePanel
class="--mobile"
:is-expanded="expandedGuidelines"
hideOnDesktop
:isExpanded="expandedGuidelines"
@toggle-expand="expandedGuidelines = !expandedGuidelines"
>
<template #panelHeader>
Expand Down Expand Up @@ -500,9 +500,18 @@ export default {
display: flex;
align-items: center;
justify-content: center;
@include media("<desktop") {
height: 80vh;
}
}
}
.bulk {
&__container {
display: flex;
flex-direction: column;
height: 100%;
min-height: 0;
}
&__records {
position: relative;
display: flex;
Expand Down Expand Up @@ -543,9 +552,4 @@ export default {
[data-title] {
@include tooltip-mini("right", 12px);
}
.--mobile {
@include media(">=desktop") {
display: none;
}
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
</HorizontalResizable>
</template>
<BaseCollapsablePanel
class="--mobile"
:is-expanded="expandedGuidelines"
hideOnDesktop
:isExpanded="expandedGuidelines"
@toggle-expand="expandedGuidelines = !expandedGuidelines"
>
<template #panelHeader>
Expand Down Expand Up @@ -206,16 +206,14 @@ export default {
display: flex;
align-items: center;
justify-content: center;
@include media("<desktop") {
height: 80vh;
}
}
}
.annotation-progress {
.--expanded & {
display: none;
}
}
.--mobile {
@include media(">=desktop") {
display: none;
}
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ export default {
},
actions: [
{
name: "copy",
name: "copy-name",
icon: "copy",
title: "Copy url to clipboard",
title: "Copy name to clipboard",
tooltip: "Copied",
},
{
name: "copy",
name: "copy-url",
icon: "link",
title: "Copy url to clipboard",
tooltip: "Copied",
Expand Down Expand Up @@ -179,7 +179,7 @@ export default {
case "go-to-settings":
this.goToSetting(dataset);
break;
case "copy":
case "copy-url":
this.copyUrl(dataset);
break;
case "copy-name":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
</template>

<script>
import { useDatasetEmptyViewModel } from "./useDatasetEmptyViewModel";
export default {
data() {
return {
Expand All @@ -20,20 +22,25 @@ export default {
},
async fetch() {
const folderContent = require.context(
`../../../../../docs/_source/_common/snippets`,
`../../../../docs/snippets`,
false,
/.start_page.md/,
"lazy"
);
const startPage = await folderContent("./start_page.md");
const content = await this.preFillData(startPage);
this.content.tabs.push({
id: "start-page",
name: "Start page",
markdown: startPage.body,
markdown: content,
});
},
setup() {
return useDatasetEmptyViewModel();
},
};
</script>
<style lang="scss" scoped>
Expand Down
Loading

0 comments on commit b997ab5

Please sign in to comment.