Skip to content

Conversation

@TomShawn
Copy link
Contributor

@TomShawn TomShawn commented Dec 10, 2020

…TORE

What is changed, added or deleted? (Required)

Change the synopsis sections of BACKUP, RESTORE and SHOW {BACKUPS|RESTORES} to use the ```ebnf+diagrm block introduced since pingcap/website-docs#83, replacing the original image-based sqlgrams (which files are deleted).

Output preview

1-fs8

The syntax diagrams are now rendered server-side as SVG when building (similar to SQLite3 / IBM DB2 / CockroachDB's docs), and user can also toggle between syntax diagram and the source EBNF (similar to Oracle's docs).

Which TiDB version(s) do your changes apply to? (Required)

  • master (the latest development version)
  • v4.0 (TiDB 4.0 versions)
  • v3.1 (TiDB 3.1 versions)
  • v3.0 (TiDB 3.0 versions)
  • v2.1 (TiDB 2.1 versions)

What is the related PR or file link(s)?

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

@TomShawn TomShawn added translation/from-docs This PR is translated from a PR in pingcap/docs. size/small Changes of a small size. status/PTAL This PR is ready for reviewing. needs-cherry-pick-4.0 labels Dec 10, 2020
![BackupTSO](/media/sqlgram/BackupTSO.png)
```ebnf+diagram
BackupStmt ::=
"BACKUP" BRIETables "TO" stringLit BackupOption*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will the blank lines affect the display?

Copy link
Contributor

@kennytm kennytm Dec 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No the parser treats new lines as the same as spaces which are ignored. Even

```ebnf+diagram
a ::= b c ::= d
```

will work

Copy link
Contributor

@ran-huang ran-huang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 10, 2020
Copy link
Contributor

@kennytm kennytm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but maybe you should fix the PR title 😉

@TomShawn TomShawn changed the title sql-statements: use ENBF to render syntax diagrams for BACKUP and RES… sql-statements: use ENBF to render syntax diagrams for BACKUP and RESTORE Dec 10, 2020
@TomShawn TomShawn merged commit d5641a6 into pingcap:master Dec 10, 2020
@TomShawn TomShawn deleted the ENBF-br-graphs branch December 10, 2020 10:01
ti-srebot pushed a commit to ti-srebot/docs-cn that referenced this pull request Dec 10, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #5074

TomShawn added a commit that referenced this pull request Dec 10, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>

Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
@lilin90 lilin90 changed the title sql-statements: use ENBF to render syntax diagrams for BACKUP and RESTORE sql-statements: use EBNF to render syntax diagrams for BACKUP and RESTORE Dec 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/small Changes of a small size. status/LGT1 Indicates that a PR has LGTM 1. status/PTAL This PR is ready for reviewing. translation/from-docs This PR is translated from a PR in pingcap/docs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants