Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Migrates soy comment blocks to the new syntax on marble-components #105
Browse files Browse the repository at this point in the history
  • Loading branch information
zenorocha committed Feb 21, 2018
1 parent 729bf89 commit d3e15a4
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 32 deletions.
45 changes: 30 additions & 15 deletions packages/electric-marble-components/src/ElectricAPIEntities.soy
@@ -1,10 +1,11 @@
{namespace ElectricAPIEntities}

/**
* @param entityData
* @param project
*/
{template .render}
{@param entityData: ?}
{@param project: ?}

<div>
{if $entityData}
{call .entity data="all" /}
Expand All @@ -13,9 +14,10 @@
{/template}

/**
* @param augments
*/
{template .augments}
{@param augments: ?}

<div class="entity-augments">
{foreach $augmentation in $augments}
<span>{$augmentation.title} </span>
Expand All @@ -30,18 +32,20 @@
{/template}

/**
* @param default
*/
{template .default}
{@param default: ?}

<div class="entity-default">
<span>Default: <code>{$default}</code></span>
</div>
{/template}

/**
* @param description
*/
{template .description}
{@param description: ?}

{if $description.type == 'html' or $description.type == 'text'}
{$description.value}
{elseif $description.type == 'inlineCode'}
Expand All @@ -56,10 +60,11 @@
{/template}

/**
* @param entityData
* @param project
*/
{template .entity}
{@param entityData: ?}
{@param project: ?}

<section class="card entity" data-access="{$entityData.access ? $entityData.access : 'public'}" id="{$entityData.name}">
{call .entityHeader data="all" /}

Expand Down Expand Up @@ -104,10 +109,11 @@
{/template}

/**
* @param entityData
* @param project
*/
{template .entityHeader}
{@param entityData: ?}
{@param project: ?}

<div class="entity-header">
{call .entityName data="all" /}

Expand All @@ -125,9 +131,10 @@
{/template}

/**
* @param entityData
*/
{template .entityName}
{@param entityData: ?}

<h1 class="entity-name">
<a href="#{$entityData.name}">
{if $entityData.access}
Expand All @@ -152,9 +159,10 @@
{/template}

/**
* @param params
*/
{template .inlineParams}
{@param params: ?}

<span>
{foreach $param in $params}
{$param.name}
Expand All @@ -171,6 +179,9 @@
* @param project
*/
{template .members}
{@param members: ?}
{@param project: ?}

<div class="entity-members">
{if $members.properties and $members.properties.length}
<h2>Properties:</h2>
Expand Down Expand Up @@ -208,9 +219,10 @@
{/template}

/**
* @param param
*/
{template .param}
{@param param: ?}

<tr>
<td>{$param.name}</td>
<td>
Expand All @@ -231,9 +243,10 @@
{/template}

/**
* @param params
*/
{template .params}
{@param params: ?}

<div class="entity-params">
<div class="datatable">
<table class="table">
Expand All @@ -257,9 +270,10 @@
{/template}

/**
* @param returns
*/
{template .returns}
{@param returns: ?}

<div class="entity-returns">
{let $return: $returns[0] /}

Expand All @@ -282,9 +296,10 @@
{/template}

/**
* @param type
*/
{template .type}
{@param type: ?}

<span>
{if $type.expression}
{$type.expression.name}
Expand Down
7 changes: 4 additions & 3 deletions packages/electric-marble-components/src/ElectricCode.soy
@@ -1,11 +1,12 @@
{namespace ElectricCode}

/**
* @param code
* @param mode
* @param? elementClasses
*/
{template .render}
{@param code: ?}
{@param mode: ?}
{@param? elementClasses: ?}

<div class="code-container{$elementClasses ? ' ' + $elementClasses: ''}">
<button class="btn btn-sm btn-copy">
<span class="icon-12-overlap"></span>
Expand Down
30 changes: 16 additions & 14 deletions packages/electric-marble-components/src/ElectricNavigation.soy
@@ -1,20 +1,21 @@
{namespace ElectricNavigation}

/**
* @param section
* @param? anchorVariant
* @param? currentDepth
* @param? currentURL
* @param? depth
* @param? elementClasses
* @param? linkClasses
* @param? listClasses
* @param? listItemActiveClasses
* @param? listItemClasses
* @param? togglerClasses
* @param? togglerLabel
*/
{template .render}
{@param section: ?}
{@param? anchorVariant: ?}
{@param? currentDepth: ?}
{@param? currentURL: ?}
{@param? depth: ?}
{@param? elementClasses: ?}
{@param? linkClasses: ?}
{@param? listClasses: ?}
{@param? listItemActiveClasses: ?}
{@param? listItemClasses: ?}
{@param? togglerClasses: ?}
{@param? togglerLabel: ?}

{let $localAnchorVariant: $anchorVariant ?: 'basic' /}
{let $localCurrentDepth: $currentDepth ?: 0 /}
{let $localListItemActiveClasses: $listItemActiveClasses ?: 'active' /}
Expand Down Expand Up @@ -60,10 +61,11 @@
{/template}

/**
* @param page
* @param? linkClasses
*/
{deltemplate ElectricNavigation.anchor variant="'basic'"}
{@param page: ?}
{@param? linkClasses: ?}

{if $page.url or $page.redirect}
<a class="{$linkClasses ?: ''}" href="{$page.redirect ?: $page.url}">
<span>{$page.title ?: 'Missing'}</span>
Expand Down

0 comments on commit d3e15a4

Please sign in to comment.