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

Attribute docinfo support #24

Open
obilodeau opened this issue Feb 3, 2020 · 0 comments
Open

Attribute docinfo support #24

obilodeau opened this issue Feb 3, 2020 · 0 comments

Comments

@obilodeau
Copy link
Member

It looks like this library doesn't support working with docinfo attributes. The converter added docinfo support here: asciidoctor/asciidoctor-reveal.js#324

Test:

// .docinfo-shared
// Demonstration of docinfo attribute and we provide only head and footer values
// :include: //head/*[last()] | //div[@class="slides"]/*[last()]
// :header_footer:
= Docinfo shared
:docinfo: shared

== Tweet

// placeholder
[#tweet]
--
--

With docinfo-revealjs.html:

<meta name="generator" content="Asciidoctor reveal.js">
<style>
  #tweet {
    display: flex;
    justify-content: center;
  }
</style>

and docinfo-footer-revealjs.html:

<script src="https://platform.twitter.com/widgets.js"></script>
<script>
  twttr.widgets.createTweet(
    '1214773648776744962',
    document.getElementById('tweet'),
    {
      theme: 'white'
    }
  );
</script>

Generated output:

<!-- .docinfo-shared -->
<script>
  var link = document.createElement( 'link' );
  link.rel = 'stylesheet';
  link.type = 'text/css';
  link.href = window.location.search.match( /print-pdf/gi ) ? "reveal.js/css/print/pdf.css" : "reveal.js/css/print/paper.css";
  document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
<section id="_tweet">
  <h2>Tweet</h2>
  <div class="openblock" id="tweet">
    <div class="content"></div>
  </div>
</section>

Instead of:

<style>
  #tweet {
    display: flex;
    justify-content: center;
  }
</style>
<script>
  twttr.widgets.createTweet(
    '1214773648776744962',
    document.getElementById('tweet'),
    {
      theme: 'white'
    }
  );
</script>

I looked at the code trying to understand what was missing and I couldn't figure it out quickly. Can someone point me in the right direction?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant