Browse Source

last touches for documentation

master
Marek Piasecki 1 year ago
parent
commit
3194db9708
  1. 1
      src/logo.svg
  2. 2
      src/views/choosing-router-style.imba
  3. 5
      src/views/installation.imba
  4. 82
      src/views/usage.imba

1
src/logo.svg

@ -1 +0,0 @@
<svg width="300" viewBox="0 0 250 95.354691"><text style="line-height:125%" x="36.909" y="41.764" font-size="55.069" letter-spacing="2.692" fill="#ae81ff">""</text><text style="line-height:125%" x="124.447" letter-spacing="2.692" fill="#ae81ff" y="40" font-size="55.069">{ }</text><path d="M82.72 55.069l18.116-27.535L82.756 0h17.371l18.08 27.534-18.08 27.535H82.72z"></path><path d="M11.025 37.495c2.924 0 5.087 2.72 5.087 6.191 0 3.472-2.163 6.434-5.087 6.392H5.604V37.495zm-9.654-4.203c-.762 0-1.371.61-1.371 1.401v32.518c0 .761.64 1.401 1.401 1.401h2.802c.792 0 1.401-.64 1.401-1.401v-12.93h7.127c5.665 0 8.985-4.869 8.985-10.595 0-5.725-3.32-10.394-8.985-10.394zM35.166 46.815c1.919 0 3.015 1.249 3.777 2.437l2.527 3.959c.488.792 1.523 1.401 2.285 1.401h3.563c.792 0 1.005-.61.518-1.401l-2.71-4.294c-1.22-1.92-2.133-2.985-3.381-3.442 3.076-.61 5.604-2.132 5.604-5.421 0-4.203-3.32-6.762-7.767-6.762H27.308c-.761 0-1.37.61-1.37 1.401v18.518c0 .761.64 1.401 1.4 1.401h2.803c.791 0 1.4-.64 1.4-1.401v-6.396h3.625zm2.71-9.32c1.706 0 3.869.61 3.869 2.559 0 1.949-2.163 2.558-3.868 2.558h-6.335v-5.117h6.335zM62.805 36.856c4.568 0 6.365 2.528 6.365 7.096 0 4.569-1.797 7.097-6.365 7.097-4.569 0-6.366-2.528-6.366-7.097 0-4.568 1.797-7.096 6.366-7.096zm-11.97 7.096c0 7.919 4.356 11.117 11.97 11.117 7.614 0 11.97-3.198 11.97-11.117 0-7.919-4.356-11.116-11.97-11.116-7.614 0-11.97 3.197-11.97 11.116z"></path><path d="M35.07 72.815c1.919 0 3.015 1.249 3.777 2.437l2.528 3.959c.487.792 1.522 1.401 2.284 1.401h3.563c.792 0 1.005-.61.518-1.401l-2.71-4.294c-1.219-1.92-2.133-2.985-3.381-3.442 3.076-.61 5.604-2.132 5.604-5.421 0-4.203-3.32-6.762-7.767-6.762H27.212c-.761 0-1.37.61-1.37 1.401v18.518c0 .761.64 1.401 1.4 1.401h2.803c.792 0 1.4-.64 1.4-1.401v-6.396h3.625zm2.71-9.32c1.706 0 3.869.61 3.869 2.559 0 1.949-2.163 2.558-3.868 2.558h-6.335v-5.117h6.335zM62.709 62.856c4.568 0 6.365 2.528 6.365 7.096 0 4.569-1.797 7.097-6.365 7.097-4.569 0-6.366-2.528-6.366-7.097 0-4.568 1.797-7.096 6.366-7.096zm-11.97 7.096c0 7.919 4.356 11.117 11.97 11.117 7.614 0 11.97-3.198 11.97-11.117 0-7.919-4.356-11.116-11.97-11.116-7.614 0-11.97 3.197-11.97 11.116zM88.432 76.53c-2.71 0-3.929-1.4-3.929-4.324V60.693c0-.791-.64-1.4-1.4-1.4H80.33c-.792 0-1.432.609-1.432 1.4v11.483c0 5.39 3.168 8.558 9.381 8.558h2.68c6.213 0 9.38-3.168 9.38-8.558V60.693c0-.791-.639-1.4-1.43-1.4h-2.772c-.762 0-1.401.609-1.401 1.4v11.513c0 2.924-1.218 4.325-3.93 4.325h-2.375zM105.37 59.292c-.792 0-1.402.61-1.402 1.401v1.401c0 .792.61 1.401 1.401 1.401h6.64v15.746c0 .762.64 1.371 1.4 1.371h2.803c.761 0 1.4-.61 1.4-1.37V63.494h6.64c.792 0 1.401-.609 1.401-1.4v-1.402c0-.791-.609-1.4-1.4-1.4h-18.884zM148.14 59.292h-17.147c-.762 0-1.401.61-1.401 1.37v18.519c0 .791.609 1.431 1.4 1.431h17.087c.792 0 1.401-.64 1.401-1.401V77.78c0-.762-.61-1.371-1.37-1.371h-12.914v-4.386h11.147c.761 0 1.401-.64 1.401-1.4V69.22c0-.761-.64-1.4-1.401-1.4h-11.147v-4.326h12.944c.761 0 1.4-.609 1.4-1.4v-1.402c0-.791-.639-1.4-1.4-1.4zM162.973 72.815c1.919 0 3.015 1.249 3.777 2.437l2.528 3.959c.487.792 1.523 1.401 2.284 1.401h3.563c.792 0 1.005-.61.518-1.401l-2.71-4.294c-1.219-1.92-2.132-2.985-3.381-3.442 3.076-.61 5.604-2.132 5.604-5.421 0-4.203-3.32-6.762-7.767-6.762h-12.274c-.761 0-1.37.61-1.37 1.401v18.518c0 .761.64 1.401 1.4 1.401h2.803c.792 0 1.4-.64 1.4-1.401v-6.396h3.625zm2.71-9.32c1.706 0 3.869.61 3.869 2.559 0 1.949-2.163 2.558-3.868 2.558h-6.335v-5.117h6.335z"></path><path d="M172.215 88.167c0 1.28.731 2.01 2.01 2.01h1.828c1.28 0 2.01-.73 2.01-2.01v-.944c0-1.28-.73-2.01-2.01-2.01h-1.827c-1.28 0-2.01.73-2.01 2.01v.944zM188.034 75.01a.897.897 0 0 0-.914-.914h-3.32a.897.897 0 0 0-.913.914v13.34c0 2.68-1.066 3.472-1.98 3.472-.579 0-.975-.213-1.523-.213h-.457a.897.897 0 0 0-.913.913v1.614c0 .457.395.792.913.914.914.213 2.437.305 3.35.305 3.625 0 5.757-2.132 5.757-7.005V75.01zm-5.208-4.386c0 1.066.64 1.706 1.705 1.706h1.858c1.066 0 1.706-.64 1.706-1.706v-.518c0-1.066-.64-1.705-1.706-1.705h-1.858c-1.066 0-1.705.64-1.705 1.705v.518zM208.704 85.517c0-6.213-11.239-4.751-11.239-7.279 0-.853.853-1.431 2.955-1.431 1.31 0 2.436.365 2.954 1.005.396.487.944.792 1.705.792h2.224a.897.897 0 0 0 .913-.914c0-3.168-3.167-4.264-8.162-4.264-4.294 0-7.736 1.37-7.736 4.812 0 6.152 11.239 4.751 11.239 7.28 0 .852-.853 1.43-3.412 1.43-1.31 0-2.436-.365-2.954-1.004-.396-.488-.944-.792-1.705-.792h-2.224a.897.897 0 0 0-.913.913c0 3.168 3.167 4.264 8.162 4.264 4.751 0 8.193-1.37 8.193-4.812z"></path></svg>

Before

Width:  |  Height:  |  Size: 4.4 KiB

2
src/views/choosing-router-style.imba

@ -45,7 +45,7 @@ tag view-choosing-router-style
<imba-code.no-code url="example.com/?view=with&variabled=url">
"URL variables are old standard which is going out of common use - considered ugly to read. Still the good thing is
it's widely supported. It's supported by browsers and backends. It's great oportunity. You could use it in many ways.
For example copy values from URL to your API requests. This would give easy way (for authorised only) to modify behaviour of your backend.
For example copy values from URL to your API requests. This would give an easy way (for authorised only) to modify behaviour of your backend.
Helpful for testing, debugging or switching feature flags."
<br>
<br>

5
src/views/installation.imba

@ -26,5 +26,6 @@ tag view-installation
"""
<br>
"3. "
<b> "There is no three. "
"Everything is already set."
<b> "Add "
<.bordered> "<pro-router>"
" tag somewhere in your layout."

82
src/views/usage.imba

@ -12,15 +12,52 @@ tag view-usage
<h2$components.gradient> "Components"
"This integration provides "
<b> 3
" components:"
<b> "ref"
" components: "
<b> "router"
", "
<b> "toggle"
<b> "ref"
" and "
<b> "router"
<b> "toggle"
"."
<br>
<br>
<$router.bordered> "<pro-router>"
" displays current view."
<br>
<br>
"The simplest application would look like this:"
<imba-code file='src/main.imba'>
"""
imba{<c-op> '.'}mount {<c-tag> 'pro-router'}
"""
<br>
"A bit more complex example:"
<imba-code url="/{R.params.subview || ''}">
"""
{<c-tag-def> 'my-app'}
{<c-tag> 'self'}
{<c-tag> "pro-ref-f{<c-el> ' view'}{<c-op> '='}{<c-el> 'v'}"} {<c-op> 'for'} v {<c-op> 'in'} {<c-c> 'R'}{<c-op> '.'}views {<c-com> 'render menu'}
{<c-tag> "pro-router"} {<c-com> 'slot for current view'}
{<c-tag-def> 'view-hello'}
{<c-tag> 'self'} 'Hello World!'
{<c-tag-def> 'view-another-view'}
{<c-tag> 'self'} 'This is another view.'
imba{<c-op> '.'}mount {<c-tag> 'my-app'}
"""
<div[d:vcc h:140px] slot="live">
<example-menu[mb:30px]>
<{ "example-{R.param('subview')}" }>
<br>
"Notice that definition of a component with prefix {<.bordered> 'view-'} implies that there's a route."
<pro-tip>
"You can override current view and display another. For example defined by param from url:"
<imba-code>
<c-tag> "pro-router{<c-el> ' view'}{<c-op> '='}{<c-c> 'R'}{<c-op> '.'}param{<.c-br> '('}{<c-str> 'subview'}{<.c-br> ')'}"
<br>
<br>
<$ref.bordered> "<pro-ref>"
" generates a link with a proper address hooked to the router."
<br>
@ -102,43 +139,6 @@ tag view-usage
<pro-toggle.button param='night'> 'Good night'
<pro-toggle.button param='night' disabled=true> 'Switch disabled'
<br>
<br>
<$router.bordered> "<pro-router>"
" displays current view."
<br>
<br>
"The simplest application would look like this:"
<imba-code file='src/main.imba'>
"""
imba{<c-op> '.'}mount {<c-tag> 'pro-router'}
"""
<br>
"A bit more complex example:"
<imba-code url="/{R.params.subview || ''}">
"""
{<c-tag-def> 'my-app'}
{<c-tag> 'self'}
{<c-tag> "pro-ref-f{<c-el> ' view'}{<c-op> '='}{<c-el> 'v'}"} {<c-op> 'for'} v {<c-op> 'in'} {<c-c> 'R'}{<c-op> '.'}views {<c-com> 'render menu'}
{<c-tag> "pro-router"} {<c-com> 'slot for current view'}
{<c-tag-def> 'view-hello'}
{<c-tag> 'self'} 'Hello World!'
{<c-tag-def> 'view-another-view'}
{<c-tag> 'self'} 'This is another view.'
imba{<c-op> '.'}mount {<c-tag> 'my-app'}
"""
<div[d:vcc h:140px] slot="live">
<example-menu[mb:30px]>
<{ "example-{R.param('subview')}" }>
<br>
<pro-tip>
"You can override current view and display another. For example defined by param from url:"
<imba-code>
<c-tag> "pro-router{<c-el> ' view'}{<c-op> '='}{<c-c> 'R'}{<c-op> '.'}param{<.c-br> '('}{<c-str> 'subview'}{<.c-br> ')'}"
<br>
<h2$tips.gradient> "Pro-router tips"
"Further reading is not about functionalities provided by this package itself but the ones you will be using straight from pro-router."
<br>

Loading…
Cancel
Save