Skip to content

Commit

Permalink
Publish v0.7.0 [#55]
Browse files Browse the repository at this point in the history
  • Loading branch information
davidstraka2 committed Mar 13, 2022
1 parent 870421d commit 9b9f2f7
Show file tree
Hide file tree
Showing 71 changed files with 916 additions and 304 deletions.
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,29 @@ 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.7.0] (2022-03-13)

### Added

- New document objects: `.Algorithm`, `.Observation`, `.Proposition`, `.Solution`, and `.Warning` [[#51]]
- New inner environments: `.item`, `.small`, and `.underline` [[#46], [#50], [#52]]
- New outer environments: `.enumerate`, `.gather`, and `.itemize` [[#46], [#50], [#52]]
- Optionally update HTML preview and navigation only upon saving the file (not upon type) [[#45]]
- Rendering of the `star` metablock item on the `.Example` document object [[#51]]

### Changed

- Replaced the deprecated `.solution` outer environment with the new `solution` metablock item (newly available on the `.Question` document object) [[#51]]
- Tweaked and refactored stylesheets (most notable tweaks: colored document object titles, more subtle footnotes) [[#48], [#53]]

### Removed

- Support for the `title` metablock item on the `.Question` document object [[#51]]

### Chores

- Added the `clean` script [[#49]]

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

### Changed
Expand Down Expand Up @@ -126,13 +149,21 @@ 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.7.0]: https://github.com/davidstraka2/wootom/compare/v0.6.1-src...v0.7.0-src
[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
[#53]: https://github.com/davidstraka2/wootom/issues/53
[#52]: https://github.com/davidstraka2/wootom/pull/52
[#51]: https://github.com/davidstraka2/wootom/issues/51
[#50]: https://github.com/davidstraka2/wootom/issues/50
[#49]: https://github.com/davidstraka2/wootom/issues/49
[#46]: https://github.com/davidstraka2/wootom/issues/46
[#45]: https://github.com/davidstraka2/wootom/issues/45
[#42]: https://github.com/davidstraka2/wootom/issues/42
[#41]: https://github.com/davidstraka2/wootom/issues/41
[#39]: https://github.com/davidstraka2/wootom/issues/39
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ mentioned dependencies.

- `npm test` - Run package tests
- `npm run build` - Build
- `npm run clean` - Clean up build output
- `npm run format:check` - Check formatting
- `npm run format:fix` - Fix formatting
- `npm run lint:check` - Lint
Expand Down
5 changes: 4 additions & 1 deletion lib/core/navigation/navigation-subscriber.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ class NavigationSubscriber {
return;
}
console.log('Wootom: Subscribing to new editor.');
this.editorSubscriptions.add(editor.onDidSave(this.updateContent.bind(this)), editor.onDidStopChanging(this.updateContent.bind(this)));
this.editorSubscriptions.add(editor.onDidSave(this.updateContent.bind(this)), editor.onDidStopChanging(() => {
if (atom.config.get('wootom.updateOnType'))
this.updateContent();
}));
this.updateContent();
}
}
Expand Down
5 changes: 4 additions & 1 deletion lib/core/preview/preview-subscriber.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ class PreviewSubscriber {
return;
}
console.log('Wootom: Subscribing to new editor.');
this.editorSubscriptions.add(editor.onDidSave(this.updateContent.bind(this)), editor.onDidStopChanging(this.updateContent.bind(this)));
this.editorSubscriptions.add(editor.onDidSave(this.updateContent.bind(this)), editor.onDidStopChanging(() => {
if (atom.config.get('wootom.updateOnType'))
this.updateContent();
}));
this.updateContent();
}
}
Expand Down
28 changes: 24 additions & 4 deletions lib/template/all-renderers.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,22 @@
Object.defineProperty(exports, "__esModule", { value: true });
exports.registerTemplateRenderers = void 0;
const core_1 = require("../core");
const algorithm_1 = require("./renderers/document-object/algorithm");
const corollary_1 = require("./renderers/document-object/corollary");
const default_1 = require("./renderers/document-object/default");
const definition_1 = require("./renderers/document-object/definition");
const example_1 = require("./renderers/document-object/example");
const figure_1 = require("./renderers/document-object/figure");
const lemma_1 = require("./renderers/document-object/lemma");
const observation_1 = require("./renderers/document-object/observation");
const proof_1 = require("./renderers/document-object/proof");
const proposition_1 = require("./renderers/document-object/proposition");
const question_1 = require("./renderers/document-object/question");
const remark_1 = require("./renderers/document-object/remark");
const solution_1 = require("./renderers/document-object/solution");
const table_1 = require("./renderers/document-object/table");
const theorem_1 = require("./renderers/document-object/theorem");
const warning_1 = require("./renderers/document-object/warning");
const default_2 = require("./renderers/document-part/default");
const h1_1 = require("./renderers/document-part/h1");
const h2_1 = require("./renderers/document-part/h2");
Expand All @@ -27,23 +32,28 @@ const i_1 = require("./renderers/inner-env/i");
const inline_math_1 = require("./renderers/inner-env/inline-math");
const quoted_1 = require("./renderers/inner-env/quoted");
const reference_1 = require("./renderers/inner-env/reference");
const small_1 = require("./renderers/inner-env/small");
const u_1 = require("./renderers/inner-env/u");
const _index_1 = require("./renderers/inner-env/_index");
const _reference_1 = require("./renderers/inner-env/_reference");
const document_root_1 = require("./renderers/other/document-root");
const indented_block_1 = require("./renderers/other/indented-block");
const inline_math_2 = require("./renderers/other/inline-math");
const text_block_1 = require("./renderers/other/text-block");
const text_node_1 = require("./renderers/other/text-node");
const align_1 = require("./renderers/outer-env/align");
const align_math_1 = require("./renderers/outer-env/align-math");
const block_math_1 = require("./renderers/outer-env/block-math");
const caption_1 = require("./renderers/outer-env/caption");
const codeblock_1 = require("./renderers/outer-env/codeblock");
const default_4 = require("./renderers/outer-env/default");
const enumerate_1 = require("./renderers/outer-env/enumerate");
const gather_math_1 = require("./renderers/outer-env/gather-math");
const quote_1 = require("./renderers/outer-env/quote");
const sage_1 = require("./renderers/outer-env/sage");
const solution_1 = require("./renderers/outer-env/solution");
const tabular_1 = require("./renderers/outer-env/tabular");
const tikz_1 = require("./renderers/outer-env/tikz");
const item_1 = require("./renderers/outer-env/item");
const itemize_1 = require("./renderers/outer-env/itemize");
function registerTemplateRenderers() {
core_1.rendererRegistry.setRenderer(new document_root_1.DocumentRootRenderer());
core_1.rendererRegistry.setRenderer(new indented_block_1.IndentedBlockRenderer());
Expand All @@ -55,26 +65,34 @@ function registerTemplateRenderers() {
core_1.rendererRegistry.setRenderer(new h2_1.DocumentPartH2Renderer());
core_1.rendererRegistry.setRenderer(new h3_1.DocumentPartH3Renderer());
core_1.rendererRegistry.setRenderer(new default_1.DefaultDocumentObjectRenderer());
core_1.rendererRegistry.setRenderer(new algorithm_1.DocumentObjectAlgorithmRenderer());
core_1.rendererRegistry.setRenderer(new definition_1.DocumentObjectDefinitionRenderer());
core_1.rendererRegistry.setRenderer(new corollary_1.DocumentObjectCorollaryRenderer());
core_1.rendererRegistry.setRenderer(new lemma_1.DocumentObjectLemmaRenderer());
core_1.rendererRegistry.setRenderer(new observation_1.DocumentObjectObservationRenderer());
core_1.rendererRegistry.setRenderer(new proposition_1.DocumentObjectPropositionRenderer());
core_1.rendererRegistry.setRenderer(new theorem_1.DocumentObjectTheoremRenderer());
core_1.rendererRegistry.setRenderer(new proof_1.DocumentObjectProofRenderer());
core_1.rendererRegistry.setRenderer(new remark_1.DocumentObjectRemarkRenderer());
core_1.rendererRegistry.setRenderer(new example_1.DocumentObjectExampleRenderer());
core_1.rendererRegistry.setRenderer(new figure_1.DocumentObjectFigureRenderer());
core_1.rendererRegistry.setRenderer(new question_1.DocumentObjectQuestionRenderer());
core_1.rendererRegistry.setRenderer(new solution_1.DocumentObjectSolutionRenderer());
core_1.rendererRegistry.setRenderer(new table_1.DocumentObjectTableRenderer());
core_1.rendererRegistry.setRenderer(new warning_1.DocumentObjectWarningRenderer());
core_1.rendererRegistry.setRenderer(new default_4.DefaultOuterEnvRenderer());
core_1.rendererRegistry.setRenderer(new align_1.OuterEnvAlignMathRenderer());
core_1.rendererRegistry.setRenderer(new align_math_1.OuterEnvAlignMathRenderer());
core_1.rendererRegistry.setRenderer(new caption_1.OuterEnvCaptionRenderer());
core_1.rendererRegistry.setRenderer(new codeblock_1.OuterEnvCodeblockRenderer());
core_1.rendererRegistry.setRenderer(new block_math_1.OuterEnvBlockMathRenderer());
core_1.rendererRegistry.setRenderer(new enumerate_1.OuterEnvEnumerateRenderer());
core_1.rendererRegistry.setRenderer(new gather_math_1.OuterEnvGatherMathRenderer());
core_1.rendererRegistry.setRenderer(new sage_1.OuterEnvSageRenderer());
core_1.rendererRegistry.setRenderer(new solution_1.OuterEnvSolutionRenderer());
core_1.rendererRegistry.setRenderer(new tabular_1.OuterEnvTabularRenderer());
core_1.rendererRegistry.setRenderer(new tikz_1.OuterEnvTikzRenderer());
core_1.rendererRegistry.setRenderer(new quote_1.OuterEnvQuoteRenderer());
core_1.rendererRegistry.setRenderer(new item_1.OuterEnvItemRenderer());
core_1.rendererRegistry.setRenderer(new itemize_1.OuterEnvItemizeRenderer());
core_1.rendererRegistry.setRenderer(new default_3.DefaultInnerEnvRenderer());
core_1.rendererRegistry.setRenderer(new cite_1.InnerEnvCiteRenderer());
core_1.rendererRegistry.setRenderer(new code_1.InnerEnvCodeRenderer());
Expand All @@ -85,6 +103,8 @@ function registerTemplateRenderers() {
core_1.rendererRegistry.setRenderer(new b_1.InnerEnvBRenderer());
core_1.rendererRegistry.setRenderer(new quoted_1.InnerEnvQuotedRenderer());
core_1.rendererRegistry.setRenderer(new reference_1.InnerEnvReferenceRenderer());
core_1.rendererRegistry.setRenderer(new small_1.InnerEnvSmallRenderer());
core_1.rendererRegistry.setRenderer(new u_1.InnerEnvURenderer());
core_1.rendererRegistry.setRenderer(new _index_1.InnerEnvIndexRenderer());
core_1.rendererRegistry.setRenderer(new _reference_1.InnerEnvUReferenceRenderer());
}
Expand Down
13 changes: 13 additions & 0 deletions lib/template/renderers/document-object/algorithm.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Renderer } from '../../../core/rendering/renderer';
import { InfoBlockColors } from '../../../util/lists/styles';
import { BasicObjectRenderer } from './basic-object';
/** Renderer of the algorithm document object */
export declare class DocumentObjectAlgorithmRenderer extends BasicObjectRenderer implements Renderer {
readonly abstractVariant = "algorithm";
/** @override */
protected title: string;
/** @override */
protected hasOptionalMetaTitle: boolean;
/** @override */
protected titleBackgroundColor: InfoBlockColors;
}
19 changes: 19 additions & 0 deletions lib/template/renderers/document-object/algorithm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DocumentObjectAlgorithmRenderer = void 0;
const styles_1 = require("../../../util/lists/styles");
const basic_object_1 = require("./basic-object");
/** Renderer of the algorithm document object */
class DocumentObjectAlgorithmRenderer extends basic_object_1.BasicObjectRenderer {
constructor() {
super(...arguments);
this.abstractVariant = 'algorithm';
/** @override */
this.title = 'Algorithm';
/** @override */
this.hasOptionalMetaTitle = true;
/** @override */
this.titleBackgroundColor = styles_1.InfoBlockColors.Blue;
}
}
exports.DocumentObjectAlgorithmRenderer = DocumentObjectAlgorithmRenderer;
26 changes: 26 additions & 0 deletions lib/template/renderers/document-object/basic-object.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { ASTNode } from '../../../core/ast/ast-node';
import { Renderer } from '../../../core/rendering/renderer';
import { RenderingManager } from '../../../core/rendering/rendering-manager';
import { WooElementKind } from '../../../util/types/woo';
/** Partially implemented renderer for the most comon document objects */
export declare abstract class BasicObjectRenderer implements Pick<Required<Renderer>, 'render' | 'kind'> {
readonly kind: WooElementKind;
/** The title of the document object */
protected abstract title: string;
/**
* Whether the document object can optionally have the title metablock item
*/
protected hasOptionalMetaTitle: boolean;
protected titleBackgroundColor?: string;
render(renderingManager: RenderingManager, astNode: ASTNode): Node;
/**
* Customize the title of the document object by appending the contents of
* the optional title metablock item, if applicable.
*
* @param title The title to customize
* @param astNode The AST node of the document object
* @returns The customized title
*/
protected customizeTitle(title: string, astNode: ASTNode): string;
private appendMetaTitle;
}
41 changes: 41 additions & 0 deletions lib/template/renderers/document-object/basic-object.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BasicObjectRenderer = void 0;
const info_block_1 = require("../../../util/html-components/info-block");
/** Partially implemented renderer for the most comon document objects */
class BasicObjectRenderer {
constructor() {
this.kind = 'DocumentObject';
/**
* Whether the document object can optionally have the title metablock item
*/
this.hasOptionalMetaTitle = false;
}
render(renderingManager, astNode) {
return info_block_1.infoBlockComponent({
title: this.customizeTitle(this.title, astNode),
children: [renderingManager.render(...astNode.children)],
titleBackgroundColor: this.titleBackgroundColor,
});
}
/**
* Customize the title of the document object by appending the contents of
* the optional title metablock item, if applicable.
*
* @param title The title to customize
* @param astNode The AST node of the document object
* @returns The customized title
*/
customizeTitle(title, astNode) {
return this.appendMetaTitle(title, astNode);
}
appendMetaTitle(title, astNode) {
if (!this.hasOptionalMetaTitle)
return title;
const titleMetadata = astNode.getMetadata('title');
if (typeof titleMetadata === 'string')
title += `: ${titleMetadata}`;
return title;
}
}
exports.BasicObjectRenderer = BasicObjectRenderer;
16 changes: 10 additions & 6 deletions lib/template/renderers/document-object/corollary.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { ASTNode } from '../../../core/ast/ast-node';
import { Renderer } from '../../../core/rendering/renderer';
import { RenderingManager } from '../../../core/rendering/rendering-manager';
import { WooElementKind } from '../../../util/types/woo';
export declare class DocumentObjectCorollaryRenderer implements Renderer {
readonly kind: WooElementKind;
import { InfoBlockColors } from '../../../util/lists/styles';
import { BasicObjectRenderer } from './basic-object';
/** Renderer of the corollary document object */
export declare class DocumentObjectCorollaryRenderer extends BasicObjectRenderer implements Renderer {
readonly abstractVariant = "corollary";
render(renderingManager: RenderingManager, astNode: ASTNode): Node;
/** @override */
protected title: string;
/** @override */
protected hasOptionalMetaTitle: boolean;
/** @override */
protected titleBackgroundColor: InfoBlockColors;
}
24 changes: 11 additions & 13 deletions lib/template/renderers/document-object/corollary.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DocumentObjectCorollaryRenderer = void 0;
const info_block_1 = require("../../../util/html-components/info-block");
class DocumentObjectCorollaryRenderer {
const styles_1 = require("../../../util/lists/styles");
const basic_object_1 = require("./basic-object");
/** Renderer of the corollary document object */
class DocumentObjectCorollaryRenderer extends basic_object_1.BasicObjectRenderer {
constructor() {
this.kind = 'DocumentObject';
super(...arguments);
this.abstractVariant = 'corollary';
}
render(renderingManager, astNode) {
let title = 'Corollary';
const titleMetadata = astNode.getMetadata('title');
if (typeof titleMetadata === 'string')
title += `: ${titleMetadata}`;
return info_block_1.infoBlockComponent({
title,
children: [renderingManager.render(...astNode.children)],
});
/** @override */
this.title = 'Corollary';
/** @override */
this.hasOptionalMetaTitle = true;
/** @override */
this.titleBackgroundColor = styles_1.InfoBlockColors.Blue;
}
}
exports.DocumentObjectCorollaryRenderer = DocumentObjectCorollaryRenderer;
1 change: 1 addition & 0 deletions lib/template/renderers/document-object/default.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ASTNode } from '../../../core/ast/ast-node';
import { Renderer } from '../../../core/rendering/renderer';
import { RenderingManager } from '../../../core/rendering/rendering-manager';
import { WooElementKind } from '../../../util/types/woo';
/** Default renderer of document objects */
export declare class DefaultDocumentObjectRenderer implements Renderer {
readonly kind: WooElementKind;
render(renderingManager: RenderingManager, astNode: ASTNode): Node;
Expand Down
1 change: 1 addition & 0 deletions lib/template/renderers/document-object/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Object.defineProperty(exports, "__esModule", { value: true });
exports.DefaultDocumentObjectRenderer = void 0;
const error_block_1 = require("../../../util/html-components/error-block");
/** Default renderer of document objects */
class DefaultDocumentObjectRenderer {
constructor() {
this.kind = 'DocumentObject';
Expand Down
16 changes: 10 additions & 6 deletions lib/template/renderers/document-object/definition.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { ASTNode } from '../../../core/ast/ast-node';
import { Renderer } from '../../../core/rendering/renderer';
import { RenderingManager } from '../../../core/rendering/rendering-manager';
import { WooElementKind } from '../../../util/types/woo';
export declare class DocumentObjectDefinitionRenderer implements Renderer {
readonly kind: WooElementKind;
import { InfoBlockColors } from '../../../util/lists/styles';
import { BasicObjectRenderer } from './basic-object';
/** Renderer of the definition document object */
export declare class DocumentObjectDefinitionRenderer extends BasicObjectRenderer implements Renderer {
readonly abstractVariant = "definition";
render(renderingManager: RenderingManager, astNode: ASTNode): Node;
/** @override */
protected title: string;
/** @override */
protected hasOptionalMetaTitle: boolean;
/** @override */
protected titleBackgroundColor: InfoBlockColors;
}
Loading

0 comments on commit 9b9f2f7

Please sign in to comment.