[alan-turing][sm] - fixes requested

This commit is contained in:
Luccas Mateus de Medeiros Gomes
2023-05-08 08:44:22 -03:00
parent e5c89308d1
commit f6b8ef2190
7 changed files with 33 additions and 34 deletions

View File

@@ -45,16 +45,8 @@ function ModeToggle() {
function toggleMode() { function toggleMode() {
disableTransitionsTemporarily() disableTransitionsTemporarily()
let darkModeMediaQuery = window.matchMedia('(prefers-color-scheme: dark)')
let isSystemDarkMode = darkModeMediaQuery.matches
let isDarkMode = document.documentElement.classList.toggle('dark') let isDarkMode = document.documentElement.classList.toggle('dark')
window.localStorage.isDarkMode = isDarkMode
if (isDarkMode === isSystemDarkMode) {
delete window.localStorage.isDarkMode
} else {
window.localStorage.isDarkMode = isDarkMode
}
} }
return ( return (

View File

@@ -12,23 +12,35 @@ If you use these resources, please cite (and read!) our paper: Directions in Abu
If youre looking for a good paper on online hate training datasets (beyond our paper, of course!) then have a look at Resources and benchmark corpora for hate speech detection: a systematic review by Poletto et al. in Language Resources and Evaluation. If youre looking for a good paper on online hate training datasets (beyond our paper, of course!) then have a look at Resources and benchmark corpora for hate speech detection: a systematic review by Poletto et al. in Language Resources and Evaluation.
<a href="#" className="w-fit mx-auto no-underline rounded-md py-3 px-6 outline-offset-2 transition active:transition-none bg-zinc-800 font-semibold text-zinc-100 hover:bg-zinc-700 active:bg-zinc-800 active:text-zinc-100/70 dark:bg-zinc-700 dark:hover:bg-zinc-600 dark:active:bg-zinc-700 dark:active:text-zinc-100/70">See the datasets</a>
## How to contribute ## How to contribute
We accept entries to our catalogue based on pull requests to the content folder. The dataset must be avaliable for download to be included in the list. If you want to add an entry, follow these steps! We accept entries to our catalogue based on pull requests to the content folder. The dataset must be avaliable for download to be included in the list. If you want to add an entry, follow these steps!
Please send just one dataset addition/edit at a time - edit it in, then save. This will make everyones life easier (including yours!) Please send just one dataset addition/edit at a time - edit it in, then save. This will make everyones life easier (including yours!)
- Go to the repo url file and click the "Add file" dropdown and then click on "Create new file". ### Create file
![](https://i.imgur.com/2PR0ZgL.png)
Go to the repo url file and click the "Add file" dropdown and then click on "Create new file".
- In the following page type `content/datasets/<name-of-the-file>.md`. if you want to add an entry to the datasets catalog or `content/keywords/<name-of-the-file>.md` if you want to add an entry to the lists of abusive keywords, if you want to just add an static page you can leave in the root of `content` it will automatically get assigned an url eg: `/content/about.md` becomes the `/about` page ![](https://i.imgur.com/2PR0ZgL.png)
![](https://i.imgur.com/rr3uSYu.png)
### Choose location
- Copy the contents of `templates/dataset.md` or `templates/keywords.md` respectively to the camp below, filling out the fields with the correct data format
![](https://i.imgur.com/x6JIjhz.png) In the following page type `content/datasets/<name-of-the-file>.md`. if you want to add an entry to the datasets catalog or `content/keywords/<name-of-the-file>.md` if you want to add an entry to the lists of abusive keywords, if you want to just add an static page you can leave in the root of `content` it will automatically get assigned an url eg: `/content/about.md` becomes the `/about` page
![](https://i.imgur.com/rr3uSYu.png)
- Click on "Commit changes", on the popup make sure you give some brief detail on the proposed change. and then click on Propose changes
<img src='https://i.imgur.com/BxuxKEJ.png' style={{ maxWidth: '50%', margin: '0 auto' }}/> ### Fill in content
- Submit the pull request on the next page when prompted. Copy the contents of `templates/dataset.md` or `templates/keywords.md` respectively to the camp below, filling out the fields with the correct data format
![](https://i.imgur.com/x6JIjhz.png)
### Commit changes
Click on "Commit changes", on the popup make sure you give some brief detail on the proposed change. and then click on Propose changes
<img src='https://i.imgur.com/BxuxKEJ.png' style={{ maxWidth: '50%', margin: '0 auto' }}/>
### Submit PR
Submit the pull request on the next page when prompted.

View File

@@ -2,11 +2,11 @@ import { Container } from '../components/Container'
import clientPromise from '../lib/mddb' import clientPromise from '../lib/mddb'
import { promises as fs } from 'fs'; import { promises as fs } from 'fs';
import { MDXRemote } from 'next-mdx-remote' import { MDXRemote } from 'next-mdx-remote'
import { serialize } from 'next-mdx-remote/serialize'
import { Card } from '../components/Card' import { Card } from '../components/Card'
import Head from 'next/head' import Head from 'next/head'
import parse from '../lib/markdown' import parse from '../lib/markdown'
import { Mermaid } from '@flowershow/core'; import { Mermaid } from '@flowershow/core';
import { Header } from '../components/Header';
export const getStaticProps = async ({ params }) => { export const getStaticProps = async ({ params }) => {
const urlPath = params.slug ? params.slug.join('/') : '' const urlPath = params.slug ? params.slug.join('/') : ''
@@ -82,10 +82,12 @@ export default function DRDPage({ mdxSource }) {
) )
return ( return (
<> <>
<Header />
<Head> <Head>
<title>{meta.title}</title> <title>{meta.title}</title>
</Head> </Head>
<Container className="mt-16 lg:mt-32"> <Container className="mt-16 lg:mt-32 relative">
<Header />
<article> <article>
<header className="flex flex-col"> <header className="flex flex-col">
<h1 className="mt-6 text-4xl font-bold tracking-tight text-zinc-800 dark:text-zinc-100 sm:text-5xl"> <h1 className="mt-6 text-4xl font-bold tracking-tight text-zinc-800 dark:text-zinc-100 sm:text-5xl">

View File

@@ -1,25 +1,17 @@
import { Head, Html, Main, NextScript } from 'next/document' import { Head, Html, Main, NextScript } from 'next/document'
const modeScript = ` const modeScript = `
let darkModeMediaQuery = window.matchMedia('(prefers-color-scheme: dark)')
updateMode() updateMode()
darkModeMediaQuery.addEventListener('change', updateModeWithoutTransitions)
window.addEventListener('storage', updateModeWithoutTransitions) window.addEventListener('storage', updateModeWithoutTransitions)
function updateMode() { function updateMode() {
let isSystemDarkMode = darkModeMediaQuery.matches let isDarkMode = window.localStorage.isDarkMode === 'true'
let isDarkMode = window.localStorage.isDarkMode === 'true' || (!('isDarkMode' in window.localStorage) && isSystemDarkMode)
if (isDarkMode) { if (isDarkMode) {
document.documentElement.classList.add('dark') document.documentElement.classList.add('dark')
} else { } else {
document.documentElement.classList.remove('dark') document.documentElement.classList.remove('dark')
} }
if (isDarkMode === isSystemDarkMode) {
delete window.localStorage.isDarkMode
}
} }
function disableTransitionsTemporarily() { function disableTransitionsTemporarily() {

View File

@@ -139,7 +139,7 @@ export default function Home({
<h1 className="text-4xl font-bold tracking-tight text-zinc-800 dark:text-zinc-100 sm:text-5xl"> <h1 className="text-4xl font-bold tracking-tight text-zinc-800 dark:text-zinc-100 sm:text-5xl">
{indexText.frontmatter.title} {indexText.frontmatter.title}
</h1> </h1>
<article className="mt-6 index-text flex flex-col gap-y-2 text-base text-zinc-600 dark:text-zinc-400 prose dark:prose-invert"> <article className="mt-6 index-text flex flex-col gap-y-2 text-base text-zinc-600 dark:text-zinc-400 prose dark:prose-invert prose-img:rounded-none prose-h3:mt-4">
<MDXRemote {...indexText} /> <MDXRemote {...indexText} />
</article> </article>
</div> </div>

View File

@@ -2,6 +2,7 @@
module.exports = { module.exports = {
content: [ content: [
"./app/**/*.{js,ts,jsx,tsx,mdx}", "./app/**/*.{js,ts,jsx,tsx,mdx}",
"./content/**/*.{js,ts,jsx,tsx,mdx}",
"./pages/**/*.{js,ts,jsx,tsx,mdx}", "./pages/**/*.{js,ts,jsx,tsx,mdx}",
"./components/**/*.{js,ts,jsx,tsx,mdx}", "./components/**/*.{js,ts,jsx,tsx,mdx}",
], ],