import { action, computed, makeObservable, observable } from 'mobx'; import { observer } from 'mobx-react'; import * as React from 'react'; import { MainViewModal } from '../views/MainViewModal'; import { SnappingManager } from './SnappingManager'; @observer export class RTFMarkup extends React.Component { // eslint-disable-next-line no-use-before-define static Instance: RTFMarkup; @observable private isOpen = false; // whether the SharingManager modal is open or not public setOpen = action((status: boolean) => { this.isOpen = status; }); constructor(props: object) { super(props); makeObservable(this); RTFMarkup.Instance = this; } /** * @returns the main interface of the SharingManager. */ @computed get cheatSheet() { return (

(( any text )) {` submit text to Chat GPT to have results appended afterward`}

{`#tag `} {` add hashtag metadata to document. e.g, #idea`}

{`#, ## ... ###### `} {` set heading style based on number of '#'s between 1 and 6`}

{`>> `} {` add a sidebar text document inline`}

{`\`\`\` `} {` create a code snippet block`}

{`cmd-f `} {` collapse to an inline footnote`}

{`cmd-e `} {` collapse to elided text`}

{`cmd-[ `} {` left justify text`}

{`cmd-\\ `} {` center text`}

{`cmd-] `} {` right justify text`}

{`%% `} {` restore default styling`}

{`%color `} {` changes text color styling. e.g., %green.`}

{`%num `} {` set font size. e.g., %10 for 10pt font`}

{`%eq `} {` creates an equation block for typeset math`}

{`%/ `} {` switch between primary and alternate text (see bottom right Button for hover options).`}

{`%> `} {` create a bockquote section. Terminate with 2 carriage returns`}

{`%q `} {` start a quoted block of text that’s indented on the left and right. Terminate with %q`}

{`%d `} {` start a block text where the first line is indented`}

{`%h `} {` start a block of text that begins with a hanging indent`}

@(wiki:phrase) {` display wikipedia page for entered text (terminate with carriage return)`}

{`@(doctitle) `} {` hyperlink to document specified by it’s title`}

{`[@(doctitle.)fieldname] `} {` display value of fieldname of text document (unless (doctitle.) is used to indicate another document by it's title)`}

{`[@fieldname:value] `} {` assign value to fieldname to data document and display it (if '=' is used instead of ':' the value is set on the layout Doc. if value is wrapped in (()) then it will be sent to ChatGPT and the response will replace the value)`}

{`[@fieldname:=expression] `} {` assign a computed expression to fieldname to data document and display it (if '=:=' is used instead of ':=' the expression is set on the layout Doc. if value is wrapped in (()) then it will be sent to ChatGPT and the prompt/response will replace the value)`}

); } render() { return ( this.setOpen(false)} /> ); } }