\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{\$mol (Milis)} \pdfinfo{ /Title (mol.pdf) /Creator (Cheatography) /Author (\$mol (Milis)) /Subject (\$mol Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{A3A3A3} \definecolor{LightBackground}{HTML}{F3F3F3} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{\$mol Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{\$mol (Milis)} via \textcolor{DarkBackground}{\uline{cheatography.com/179159/cs/37306/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}\$mol (Milis) \\ \uline{cheatography.com/milis} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 24th February, 2023.\\ Updated 27th October, 2023.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{2} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{\$mol - это}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Реактивный \seqsplit{микромодульный} веб фреймворк для разработки \seqsplit{прогрессивных} приложений. Очень простой, но весьма мощный.% Row Count 5 (+ 5) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Сайт: https://mol.hyoo.ru/ \newline Телеграм: https://t.me/mam\_mol} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Ваша цель №1. Быстрый старт}} \tn % Row 0 \SetRowColor{LightBackground} 1. Скачать и запустить \$mol и плагины & Вы увидите работу \$mol и все его \seqsplit{особенности}. \seqsplit{Посмотрите} на проекты и файлы, которые \seqsplit{установились}. \tn % Row Count 9 (+ 9) % Row 1 \SetRowColor{white} 2. Создать проект My Hello World & Следуйте \seqsplit{инструкции} по созданию проекта. Обращайте внимание на файлы, именна \seqsplit{переменных} и синтаксис, которые \seqsplit{используются}. Запустите в браузере! \tn % Row Count 23 (+ 14) % Row 2 \SetRowColor{LightBackground} 3. \seqsplit{Опубликовать} проект на GitHub Pages & Добавьте 1 файл и несколько настроек в GitHub по \seqsplit{инструкции}. \seqsplit{Опубликованный} сайт за пару минут - это просто! \tn % Row Count 33 (+ 10) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Как скачать и запустить \$mol?}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{git clone \seqsplit{https://github.com/hyoo-ru/mam.git} ./mam \&\& cd mam \newline npm install \&\& npm start} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{6.24 cm} x{1.76 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Проект Hello World (/my/hello)}} \tn % Row 0 \SetRowColor{LightBackground} Запустите mam & npm start \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Создайте папку /my (имя компании) & /my \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} Создай проект /hello (имя проекта) & \seqsplit{/my/hello} \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} Перейдите в браузере на страницу & my -\textgreater{} hello \tn % Row Count 8 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\seqsplit{https://mol.js.org/app/hello/-/}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4.08 cm} x{3.92 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Как запушить на GitHub Pages?}} \tn % Row 0 \SetRowColor{LightBackground} Создать файл в проект и настроить ключи & \seqsplit{/my/hello/.github/workflows/deploy.yml} \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} Настроить \seqsplit{репозиторий} GitHub & \seqsplit{https://github.com/settings/tokens} \tn % Row Count 7 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{Инструкция \seqsplit{https://lyumihs-organization}.gitbook.io/mol-doc/faq/kak-rabotat-v-usdmol-s-git\#kak-vylozhit-svoi-modul-na-github-pages} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{p{0.8 cm} x{7.2 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Синтаксис *.view.tree}} \tn % Row 0 \SetRowColor{LightBackground} - & remarks, ignored by code generation \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \$ & component name prefix, e.g `\$mol\_button` \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} / & array, optionally you can set type of array, e.g `sub /number` \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} * & dictionary (string keys, any values) \tn % Row Count 6 (+ 1) % Row 4 \SetRowColor{LightBackground} \textasciicircum{} & return value of the same property from super class \tn % Row Count 8 (+ 2) % Row 5 \SetRowColor{white} \textbackslash{} & raw string, e.g. `message \textbackslash{}Hello` \tn % Row Count 9 (+ 1) % Row 6 \SetRowColor{LightBackground} @ & {\emph{localized string}}, e.g. `message @ \textbackslash{}Hello world` \tn % Row Count 11 (+ 2) % Row 7 \SetRowColor{white} \textless{}= & provides read-only property from owner to sub-componen \tn % Row Count 13 (+ 2) % Row 8 \SetRowColor{LightBackground} =\textgreater{} & provides read-only property from sub-componen to owner \tn % Row Count 15 (+ 2) % Row 9 \SetRowColor{white} \textless{}=\textgreater{} & fully replace sub component property by owner's one \tn % Row Count 17 (+ 2) % Row 10 \SetRowColor{LightBackground} * ! & property `*` or `!` - property takes ID as first argument, e.g. `Task\_row* \$mol\_view` \tn % Row Count 20 (+ 3) % Row 11 \SetRowColor{white} ? & property + `?` - property can be changed by providing an additional optional argument, e.g. `value \textless{}=\textgreater{} name?val \textbackslash{}` \tn % Row Count 24 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\seqsplit{https://github.com/hyoo-ru/mam\_mol/tree/master/view\#viewtree}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{2.08 cm} x{5.92 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Реактивность состояния}} \tn % Row 0 \SetRowColor{LightBackground} @ \seqsplit{\$mol\_mem} & декоратор используется для хранения и работы с единичным состоянием. \tn % Row Count 5 (+ 5) % Row 1 \SetRowColor{white} @ \seqsplit{\$mol\_mem\_key} & декоратор для хранения и работы с коллекцией состояний. \tn % Row Count 9 (+ 4) % Row 2 \SetRowColor{LightBackground} @ \seqsplit{\$mol\_action} & декоратор для работы с асинхронным кодом \tn % Row Count 12 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{https://page.hyoo.ru/\#!=1fcpsq\_1wh0h2 \newline https://github.com/hyoo-ru/mam\_mol/tree/master/wire} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{index.html - точка входа в проект}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{\textless{}!doctype html\textgreater{} \textless{}!-{}- Disable quirks mode -{}-\textgreater{} \newline \textless{}html mol\_view\_root\textgreater{} \textless{}!-{}- Reset root styles -{}-\textgreater{} \newline \textless{}head\textgreater{} \newline \textless{}meta charset="utf-8" /\textgreater{} \textless{}!-{}- Force utf-8 encoding -{}-\textgreater{} \newline \textless{}meta name="viewport" \newline content="width=device-width, height=device-height, initial-scale=1" \newline /\textgreater{} \textless{}!-{}- Disable mobile browser auto zoom, \$mol is adaptive -{}-\textgreater{} \newline \textless{}meta \seqsplit{name="mobile-web-app-capable"} content="yes"\textgreater{} \textless{}!-{}- Fullscreen support -{}-\textgreater{} \newline \textless{}meta \seqsplit{name="apple-mobile-web-app-capable"} content="yes"\textgreater{} \newline \textless{}/head\textgreater{} \newline \textless{}body mol\_view\_root\textgreater{} \textless{}!-{}- Reset root styles -{}-\textgreater{} \newline \textless{}div mol\_view\_root="\$my\_hello"\textgreater{}\textless{}/div\textgreater{} \textless{}!-{}- Autobind component to element on load -{}-\textgreater{} \newline \textless{}script src="web.js"\textgreater{}\textless{}/script\textgreater{} \textless{}!-{}- Load autogenerated js bundle -{}-\textgreater{} \newline \textless{}/body\textgreater{} \newline \textless{}/html\textgreater{}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{index.view.tree - Шаблон страницы}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{\$my\_hello \$mol\_view \newline sub / \newline \textless{}= Name \$mol\_string \newline hint @ \textbackslash{}Name \newline value? \textless{}=\textgreater{} name? \textbackslash{} \newline \textless{}= message \textbackslash{}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{@ - это строка доступна для локализации} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{hello.view.ts Поведение страницы}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{namespace \$.\$\$ \{ \newline export class \$my\_hello extends \$.\$my\_hello \{ \newline \newline message() \{ \newline const name = this.name() \newline return name \&\& `Hello, \$\{name\}!` \newline \} \newline \newline \} \newline \}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{hello.test.ts - тестирование}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{namespace \$.\$\$ \{ \newline \newline \$mol\_test( \{ \newline \newline 'Generating greeting message'() \{ \newline \newline const app = new \$my\_hello \newline \$mol\_assert\_equal( app.message(), '' ) \newline \newline app.name( 'Jin' ) \newline \$mol\_assert\_equal( app.message(), 'Hello, Jin!' ) \newline \newline \} \newline \newline \} ) \newline \newline \}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{hello.view.css}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{{[}my\_hello{]} \{ \newline display: flex; \newline flex-direction: column; \newline align-items: center; \newline box-shadow: 0 0 0 1px var(-{}-mol\_theme\_line); \newline \} \newline \newline {[}my\_hello\_name{]} \{ \newline flex-grow: 0; \newline margin: 1rem; \newline width: 14rem; \newline \}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{hello.locale=ru.json - переводы}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{\{ \newline "\$my\_hello\_Name\_hint": "Имя" \newline \}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}