Skip to content

Commit

Permalink
Publish v0.6.1 [#43]
Browse files Browse the repository at this point in the history
  • Loading branch information
davidstraka2 committed Jun 24, 2021
1 parent a903482 commit 870421d
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 13 deletions.
28 changes: 23 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,24 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.6.1] (2021-06-24)

### Changed

- Improve the display of errors raised during TikZ SVG creation [[#42]]

### Fixed

- Use the OS tmp directory for working with files related to TikZ SVG creation
[[#41]]

## [0.6.0] (2021-05-13)

### Added

- FIT Template snippets [[#37]]
- Rendering of the `footnote` inner environment and partial rendering of the
`cite`, `eqref`, and `reference` inner environments [[#39]]
`.cite`, `.eqref`, and `.reference` inner environments [[#39]]

### Changed

Expand All @@ -31,8 +42,10 @@ and this project adheres to

### Added

- Navigation pane with table of contents, table of labels, and fuzzy seach [[#33]]
- Cached rendering of TikZ images to SVG (in `!tikz` outer environments) [[#32]]
- Navigation pane with table of contents, table of labels, and fuzzy search
[[#33]]
- Cached rendering of TikZ images to SVG (in `!tikz` outer environments)
[[#32]]
- Caching of MathJax results [[#31]]

### Changed
Expand All @@ -43,11 +56,13 @@ and this project adheres to
### Fixed

- Infinite loop in rendering causing Atom crash [[#28]]
- MathJax failing to typeset when there is only one element to be typeset [[#30]]
- MathJax failing to typeset when there is only one element to be typeset
[[#30]]

### Chores

- CI testing matrix now additionally contains the minimum supported Atom version [[#29]]
- CI testing matrix now additionally contains the minimum supported Atom
version [[#29]]
- Tweaked TS compiler settings (esModuleInterop) [[#33]]

## [0.4.0] (2021-04-20)
Expand Down Expand Up @@ -111,12 +126,15 @@ and this project adheres to
- Set up linting with ESLint (and typescript-eslint/eslint-plugin) [[#10]]
- Set up CI using GitHub Actions [[#6], [#7], [#9], [#11]]

[0.6.1]: https://github.com/davidstraka2/wootom/compare/v0.6.0-src...v0.6.1-src
[0.6.0]: https://github.com/davidstraka2/wootom/compare/v0.5.0-src...v0.6.0-src
[0.5.0]: https://github.com/davidstraka2/wootom/compare/v0.4.0-src...v0.5.0-src
[0.4.0]: https://github.com/davidstraka2/wootom/compare/v0.3.0-src...v0.4.0-src
[0.3.0]: https://github.com/davidstraka2/wootom/compare/v0.2.0-src...v0.3.0-src
[0.2.0]: https://github.com/davidstraka2/wootom/compare/v0.1.0-src...v0.2.0-src
[0.1.0]: https://github.com/davidstraka2/wootom/releases/tag/v0.1.0-src
[#42]: https://github.com/davidstraka2/wootom/issues/42
[#41]: https://github.com/davidstraka2/wootom/issues/41
[#39]: https://github.com/davidstraka2/wootom/issues/39
[#38]: https://github.com/davidstraka2/wootom/issues/38
[#37]: https://github.com/davidstraka2/wootom/issues/37
Expand Down
12 changes: 10 additions & 2 deletions lib/template/renderers/outer-env/tikz.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,20 @@ class OuterEnvTikzRenderer {
* @param errorLog The error log
* @returns A new component
*/
getErrorDetail(errorLog) {
getErrorDetail(error) {
var _a;
const details = document.createElement('details');
details.classList.add('wootom-error-details');
const summary = document.createElement('summary');
summary.append('Error generating TikZ SVG.');
summary.title = 'Click to toggle error details';
const pre = document.createElement('pre');
pre.append(errorLog);
if (typeof error === 'string') {
pre.append(error);
}
else {
pre.append((_a = error.stack) !== null && _a !== void 0 ? _a : error.toString());
}
details.append(summary, pre);
return details;
}
Expand Down
10 changes: 5 additions & 5 deletions lib/template/tikz.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const execa_1 = __importDefault(require("execa"));
const fs = __importStar(require("fs-extra"));
const uuid_1 = require("uuid");
const path = __importStar(require("path"));
const os = __importStar(require("os"));
/**
* A simple cache for TikZ SVGs. The key is the TikZ source code, the value is
* the SVG (as a text) generated from the TikZ source.
Expand All @@ -59,9 +60,8 @@ function tikzToSVG(source, options = '') {
console.log('Wootom: Hit TikZ SVG cache.');
return tikzCache[cacheKey];
}
const dirname = `.wootom/tikz/${uuid_1.v4()}`;
const resDirname = path.resolve(process.cwd(), dirname);
console.log(`Wootom: Generating TikZ SVG in "${resDirname}"`);
const dirname = path.resolve(os.tmpdir(), `.wootom/tikz/${uuid_1.v4()}`);
console.log(`Wootom: Generating TikZ SVG in "${dirname}"`);
yield fs.emptyDir(dirname);
const filename = `main`;
yield fs.writeFile(`${dirname}/${filename}.tex`, getLatex(source, options));
Expand All @@ -72,12 +72,12 @@ function tikzToSVG(source, options = '') {
}
catch (err) {
const log = yield fs.readFile(`${dirname}/${filename}.log`, 'utf-8');
console.log(`Wootom: Cleaning up "${resDirname}" after failing to generate TikZ SVG`);
console.log(`Wootom: Cleaning up "${dirname}" after failing to generate TikZ SVG`);
yield fs.remove(dirname);
throw log;
}
const svg = yield fs.readFile(`${dirname}/${filename}.svg`, 'utf-8');
console.log(`Wootom: Cleaning up "${resDirname}" after generating TikZ SVG`);
console.log(`Wootom: Cleaning up "${dirname}" after generating TikZ SVG`);
yield fs.remove(dirname);
const finalSVG = svg.trim();
tikzCache[cacheKey] = finalSVG;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wootom",
"version": "0.6.0",
"version": "0.6.1",
"author": {
"name": "David Straka",
"email": "davidstraka.public@gmail.com"
Expand Down
9 changes: 9 additions & 0 deletions styles/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@
}
}

details.wootom-error-details {
border: 1px solid var(--color-translucent-red);

> summary {
background-color: var(--color-translucent-red);
cursor: pointer;
}
}

svg.wootom-tikz {
&.wootom-tikz-inverted {
filter: invert(1);
Expand Down

0 comments on commit 870421d

Please sign in to comment.