Emergency Hamburg Wiki

Code Blocks

Fenced code with a title, a starting line number and highlighted lines.

Code Blocks

A plain fence, with the language named:

const wiki = await connect()
await wiki.pages.create({ path: 'home', title: 'Home' })

With a title

backend/models/mail.ts
export const mail = new Mail()

Numbered from somewhere else

Useful when the excerpt starts partway through a file.

api/authentication.ts
app.post('/sites/:siteId/auth/verifyEmail', {
  config: { publicAccess: true },
  onRequest: limitAuthAttempts
}, async (req, reply) => {
  await WIKI.models.users.verifyUserEmail(req.body.token)
  return { ok: true }
})

With lines called out

fetchStrategies
async function fetchStrategies() {
  try {
    state.strategies = await API_CLIENT.get('auth/strategies').json()
  } catch (err) {
    notify({ type: 'negative', message: err.message })
  } finally {
    state.strategiesLoaded = true
  }
}

Other languages

config.yml
port: 3000
db:
  host: db
  user: postgres
SELECT "folderPath", "fileName" FROM tree WHERE tree = 'folder';
node backend

See also