Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] @example : the generated code block of the doc gets unexpected spaces #253

Closed
rdkmaster opened this issue Jul 30, 2017 · 13 comments
Closed

Comments

@rdkmaster
Copy link

Overview of the issue

the generated code block of the doc gets unexpected spaces, see the image below

Operating System, Node.js, npm, compodoc version(s)

win10 64, node6.10, npm 3.10

Angular configuration, a package.json file in the root folder

yes

Compodoc installed globally or locally ?

locally

Motivation for or Use Case

the generated code block of the doc gets unexpected spaces

Reproduce the error

use the comment:

    /**
     * Shows all events on a given day. Example usage:
     *
     * ```html
     * <mwl-calendar-day-view
     *             [viewDate]="viewDate"
     *             [events]="events">
     * </mwl-calendar-day-view>
     * ```
     */
Related issues

no

additional info
@rdkmaster
Copy link
Author

default

@bartvanvliet
Copy link

bartvanvliet commented Jul 30, 2017

@rdkmaster

It's because you are using the ```html tag as you would in markdown.

Please supply it like this:

/**
  * Shows all events on a given day. Example usage:
  *
  * @example
  * <mwl-calendar-day-view
  *             [viewDate]="viewDate"
  *             [events]="events">
  * </mwl-calendar-day-view>
  */

@rdkmaster
Copy link
Author

I tried @example seconds ago, and the example is gone!

default

@bartvanvliet
Copy link

@rdkmaster Where did you place the @example comment?

It should be at root level for example:

/**
 * The datagrid component for displaying lists of data.
 *
 * @example
 * <sr-datagrid
 *               [datagridFormat]="datagridFormat"
 *               [loading]="loading"
 *               [(rows)]="rows">
 *               <sr-datagrid-search
 *                 (onSearch)="onSearch($event)"></sr-datagrid-search>
 *               <sr-datagrid-button
 *                 [textTranslationKey]="'GRID.ADD_USER'"
 *                 (onClick)="onClick($event)"></sr-datagrid-button>
 *               <sr-datagrid-toggle
 *                 (onSwitch)="onSwitch($event)"></sr-datagrid-toggle>
 * </sr-datagrid>
 */
@Component({
  selector: 'sr-datagrid',
  templateUrl: './datagrid.component.html',
  styleUrls: []
})
export class DatagridComponent implements OnInit {}

@rdkmaster
Copy link
Author

rdkmaster commented Jul 30, 2017

I copied the example from here, and here is my code

    /**
     * Shows all events on a given day. Example usage:
     *
     * @example
     * <mwl-calendar-day-view
     *             [viewDate]="viewDate"
     *             [events]="events">
     * </mwl-calendar-day-view>
     */
    test2() {

    }

@bartvanvliet
Copy link

@rdkmaster That's not on the root level. You are giving an example to a function called test. Look at my example 😄

@rdkmaster
Copy link
Author

rdkmaster commented Jul 30, 2017

what do you mean by root level? Are u saying that the @example can be only used outter of the class which means "the root level"?

I have rolled back my code, and I can't try it now, maybe I'll try this sometime later.

@bartvanvliet
Copy link

@rdkmaster Outer class level indeed.

@rdkmaster
Copy link
Author

rdkmaster commented Jul 30, 2017

ok thanks, outter of the class seems to be quite a limit.

Is there any way to use the markdown style code block and avoid the unexpected spaces?

@vogloblinsky vogloblinsky changed the title the generated code block of the doc gets unexpected spaces [BUG] @example : the generated code block of the doc gets unexpected spaces Jul 30, 2017
@vogloblinsky
Copy link
Contributor

I confirm this is not normal to doesn't support @example for inner function or properties of class.
Working on that tomorrow.

@vogloblinsky vogloblinsky added this to the 1.0.0-beta.14 milestone Jul 30, 2017
@bartvanvliet
Copy link

bartvanvliet commented Jul 31, 2017

@vogloblinsky Sorry, Didn't know this was actually not expected behaviour ☹️

@vogloblinsky
Copy link
Contributor

vogloblinsky commented Jul 31, 2017

@Kapulara
It should be but i miss to test it everywhere (outter class and inside for functions etc).
Thanks for helping @rdkmaster.

@lock
Copy link

lock bot commented Oct 1, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem. Why locking ? Having issues with the most up-to-date context.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants