{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", " \n", " \n", " \n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Text\n", "\n", "Text [component](00_components.ipynb) creation in Epyk will be using the function text from the ui property.\n", "\n", "the ui entry point will give you access to all the registered components.\n", "Different flavour of buttons are available in the framework.\n", "\n", "There are multiple flaviour of text in the framework but the default one added as a shortcut to ui is a component using div as underlying. Div is the generic container on the HTML space.\n", "\n", "## Basic text" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "
This is a text
\n", "\n", "" ], "text/plain": [ "" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from epyk.core.Page import Report\n", "\n", "rptObj = Report()\n", "text = rptObj.ui.text(\"This is a text\")\n", "\n", "rptObj.outs.jupyter()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Styling and events\n", "\n", "Same way than all the other component it is possible to add style or Javascript event to this component.\n", "\n", "Some shortcut functions are also available for the common style changes.\n", "In a proper IDE they should appear with a proper documentation." ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "
This is a text
\n", "\n", "" ], "text/plain": [ "" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from epyk.core.Page import Report\n", "\n", "rptObj = Report()\n", "text = rptObj.ui.text(\"This is a text\")\n", "text.style.css.bold()\n", "text.style.css.shadow_text()\n", "text.click([\n", " rptObj.js.alert(\"This is an alert\")\n", "])\n", "rptObj.outs.jupyter()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Other texts\n", "\n", "Other flavours of texts are available from the property **texts**." ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "Test\n", "
Test
Test content
\n", "
Test
\n", "\n", "" ], "text/plain": [ "" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from epyk.core.Page import Report\n", "\n", "rptObj = Report()\n", "rptObj.ui.texts.label(\"Test\")\n", "rptObj.ui.texts.span(\"Test\")\n", "rptObj.ui.texts.highlights(\"Test content\", title=\"Test\", icon=\"fab fa-angellist\")\n", "rptObj.ui.title(\"Test\")\n", "\n", "rptObj.outs.jupyter()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Go back to the tutorials page\n", "
\n", "Do not forget that this is a collaborative framework so do not hesitate to give feedbacks and like the different repository to get more visbility.\n", "\n", "Also any help is more than welcome !" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.2" } }, "nbformat": 4, "nbformat_minor": 4 }