Giter VIP home page Giter VIP logo

vuepress-plugin-tabs's Introduction

Version License

Vuepress plugin - markdown custom container to display content in tabs from Element UI

Docs

https://superbiger.github.io/vuepress-plugin-tabs

Install

This plugin requires VuePress >= 1.0.0, for now you can try it via yarn add vuepress@next -D

yarn add vuepress-plugin-element-tabs -D
// .vuepress/config.js
module.exports = {
  plugins: [
    'vuepress-plugin-element-tabs'
  ]
}

Usage

:::: tabs

::: tab title
__markdown content__
:::


::: tab javascript
``` javascript
() => {
  console.log('Javascript code example')
}
```
:::

::::

Documents

Accepted Value Like That

:::: tabs type:board-card
::: tab title lazy
__markdown content__
:::
::::

Tabs Attributes

Attribute Description Type Accepted Values Default
type type of Tab String card/border-card border-card
tab-position position of tabs String top/right/bottom/left top
stretch whether width of tab automatically fits its container Boolean - false

Tab Attributes

Attribute Description Type Accepted Values Default
label title of the tab String - -
lazy whether Tab is lazily rendered Boolean - false

Q&A

  • How to get mouse position with canvas ?
var canvas = document.getElementById('screen');
var mouse = getMouse(canvas);

function addEvent(obj, type, handle) {
  try {
    obj.addEventListener(type, handle, false);
  } catch (e) {
    try {
      obj.attachEvent("on" + type, handle);
    } catch (e) {
      obj["on" + type] = handle;
    }
  }
}

function getMouse(element) {
  var mouse = { x: 0, y: 0 };

  addEvent(element, "mousemove", function(e) {
    var x, y;
    var e = e || window.event;
    const box = element.getBoundingClientRect();
    x = e.clientX - box.x;
    y = e.clientY - box.y;
    mouse.x = x;
    mouse.y = y;
  });

  return mouse;
}

vuepress-plugin-tabs's People

Contributors

dependabot[bot] avatar kaifuny avatar magic-doufu avatar zhangyuannie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

vuepress-plugin-tabs's Issues

Possible to keep multiple tabs in sync?

So for my documentation site I have something like this:

:::: tabs
::: tab PHP
 // Some code
:::
::: tab Javascript
 // Some code
:::
::::

And then on another page I have the same setup. Is it possible that when I click on, for example, javascript that that decision would retain on each page? So that on each page the javascript tab is active?

[Question] Nested tabs

I need nested tabs for a set of programming languages in different environments. I need two levels of tabs like shown below. Any idea how to do it?

Screenshot from 2020-10-07 04-15-05

Tabs make my browser crash when built in github pages

First of all, thanks for this wonderfull plugin.

This is a very very specific bug in a very specific situation. I cannot wrap my head arround it so I would like your input on it.
Maybe you have a clue.

I use your plugin for the documentation of MeiliSearch. It works great in every page, but in ONE circumstance it makes the whole browser crash.

If you go to the getting started guide from any page of the website, everything works correctly.

BUT

If you go to the getting started guide directly from its url : https://docs.meilisearch.com/guides/introduction/quick_start_guide.html then it makes the browser crash.
It also crashes if you refresh the page.

I cannot reproduce this bug in local (nor in development nor in production).
This bug only appears when it is built on a github page (the bug does not exist on netlify neither).
https://deploy-preview-426--dreamy-wiles-8fd85b.netlify.app/guides/introduction/quick_start_guide.html.

Tests

I made a lot of tests and the problem appears when I add 4 or more "tabs" in the same md page.
I cannot find a way to properly debug this.

Any advice is welcome. I realise this bug is crazy but maybe i'm missing something obvious.

This is the repo: https://github.com/meilisearch/documentation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.