GoogleCloudPlatform / GoogleCloudPlatform/knowledge-catalog

Clarify inline citation syntax in the OKF specification

Open
#199 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
9.2k
Forks
782
Avg merge
6h 36m
Merged PRs (30d)
85

Description

## Clarify inline citation syntax in the OKF specification

### What problem does this solve?

The OKF specification defines a numbered `# Citations` section:

```markdown
# Citations

[1] [First source](https://example.com/first)
[2] [Second source](https://example.com/second)
```

However, the specification does not define how a claim in the document body should reference these citations.

A natural generated output is:

```markdown
Crossplane real-time compositions are enabled by default.[1][2]
```

Markdown parsers do not interpret this as two independent citation markers.

Instead, `[1][2]` is parsed as a reference-style Markdown link:

```markdown
[link text][reference identifier]
```

In this example:

* `1` is the link text.
* `2` is the reference identifier.

The parser therefore expects a reference definition like:

```markdown
[2]: https://example.com/source
```

The citation format currently shown in the OKF specification does not create such a reference definition:

```markdown
[2] [Second source](https://example.com/second)
```

As a result, editors such as IntelliJ report `[2]` as an unresolved reference.

The same problem occurs with other citation combinations such as:

```markdown
[3][4]
```

Here, `[4]` is interpreted as the unresolved reference identifier.

### Example

```markdown
---
type: concept
title: Example
---

# Overview

This feature is enabled by default.[1][2]

# Citations

[1] [Feature documentation](https://example.com/documentation)
[2] [Source code implementation](https://example.com/source)
```

The document is readable by humans, but the relationship between the inline markers and the citation list is not represented using standard Markdown link semantics.

### Expected behavior

The OKF specification should explicitly define how citations are referenced from the document body.

The defined syntax should:

* be unambiguous for Markdown parsers;
* work with multiple citations on one claim;
* avoid unresolved-reference warnings in Markdown editors;
* clearly associate an inline citation with its entry under `# Citations`;
* remain easy for humans and agents to generate.

### Possible solution: Markdown footnotes

One option is to use Markdown footnotes:

```markdown
# Overview

This feature is enabled by default.[^1][^2]

# Citations

[^1]: [Feature documentation](https://example.com/documentation)
[^2]: [Source code implementation](https://example.com/source)
```

This syntax clearly connects the claim with the source definitions.

However, footnotes are not supported by every Markdown implementation, so the specification would need to state whether footnote support is required.

### Alternative: explicit reference-style links

Another option is to define standard Markdown reference links:

```markdown
# Overview

This feature is enabled by default.[1][citation-1] [2][citation-2]

# Citations

[1] [Feature documentation](https://example.com/documentation)
[2] [Source code implementation](https://example.com/source)

[citation-1]: https://example.com/documentation
[citation-2]: https://example.com/source
```

This is valid reference-style Markdown, but it duplicates the URLs and is more verbose.

### Suggested specification change

Please add an explicit inline citation syntax to the `Citations` section of the specification, including:

1. an example with one citation;
2. an example with multiple citations;
3. the corresponding citation definitions;
4. a statement about which Markdown dialect or extension OKF expects consumers to support.

Without this clarification, different OKF producers may generate incompatible citation syntax even though all of them follow the current numbered citation-list example.

Contributor guide

Open the contributing guide

Research direction

Start by locating the OKF specification and its `# Citations` section, then review the existing numbered citation examples and the Markdown dialects supported by consumers. Define one unambiguous syntax with single- and multiple-citation examples, matching definitions, and a statement of required Markdown support; the work is done when the specification fully documents these rules.

Written by the indexing model from the issue text.

Assessment

Tech stack
markdown
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.