Skip to content

Instantly share code, notes, and snippets.

@slashfan
Created November 17, 2017 09:33
Show Gist options
  • Save slashfan/d9330022cfd5c3928eba0906b3af657e to your computer and use it in GitHub Desktop.
Save slashfan/d9330022cfd5c3928eba0906b3af657e to your computer and use it in GitHub Desktop.
Lexik Doc

Insertion :

<script>
    window.lxdoc = window.lxdoc || function () {(lxdoc.q = lxdoc.q || []).push(arguments)};
    lxdoc('project', 'demo');
</script>
<script async src='https://cdn.lexik.fr/widget.js'></script>

Ajout du contexte de la page :

<script>
    window.lxdoc = window.lxdoc || function () {(lxdoc.q = lxdoc.q || []).push(arguments)};
    lxdoc('project', 'demo');
    lxdoc('context', {
        route: 'demo_page_1'
    });
</script>
<script async src='https://cdn.lexik.fr/widget.js'></script>

Personnalisation :

<script>
    window.lxdoc = window.lxdoc || function () {(lxdoc.q = lxdoc.q || []).push(arguments)};
    lxdoc('project', 'demo');
    lxdoc('context', {
        route: 'demo_page_1'
    });
    lxdoc('config', {
        color: '#CA0048',
        theme: 'dark'
    });
</script>
<script async src='https://cdn.lexik.fr/widget.js'></script>

Utilisation de l'API JS asynchrone :

<script>
    window.lxdoc = window.lxdoc || function () {(lxdoc.q = lxdoc.q || []).push(arguments)};
    lxdoc('project', 'demo');
    lxdoc('context', {
        route: 'demo_page_1'
    });
    lxdoc('config', {
        color: '#CA0048',
        theme: 'dark'
    });
</script>
<script async src='https://cdn.lexik.fr/widget.js'></script>
<script>
    setTimeout(function () {
        lxdoc('open');
    }, 2500);
</script>

Propriétés (setters) :

  • project string lxdoc('project', 'demo')
  • context object lxdoc('context', {})
  • path string lxdoc('path', '/demo') deprecated
  • reference string lxdoc('reference', 'demo') deprecated

Méthodes:

  • open() lxdoc('open')
  • close() lxdoc('close')
  • toggle() lxdoc('toggle')
  • expand() lxdoc('expand')
  • refresh() lxdoc('refresh')

Options :

  • config
    • color: string
    • opacity: number
    • zIndex: number
    • theme: string
    • locale: string
    • eager: boolean default true
    • showBeacon: boolean default true
    • showSatellites: boolean default true
    • satellitesTriggerMode: string default 'click'
    • ready: function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment