Skip to content

Cleaning: Regexes for figure and table sections GATSBY #216

Description

@oldenbourglaura

Gatsby Chapters

  • Copy chapter in VS Code

IMAGES

A) Find the end of an image section and add a comment, works for most of the cases:

FIND regex*

(\[\[File:[^\]]+\]\]\n\n)([\s\S]*?[Ff]igure[\s\S]*?\n)\n

REPLACE

$1$2<!-- END IMG -->
\n

B) Find figures and add a start comment

FIND regex*

(\[\[File:[^\]]+\]\])

REPLACE

<!-- START IMG -->
<!-- IMG FILE -->
$1
<!-- IMG TITLE + CAPTION -->
  • Then skip through all files and correct the rest (table images, longer captions)

TABLES

A) Count the tables

FIND

{| class="wikitable"

B) Add a start comment

C) Add an end comment

FIND

|}

REPLACE

|}
<!-- END TABLE -->

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

Status
No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions