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

Iframe gimmick should be named 'iframe' instead of 'forkmeongithub' #71

Merged
merged 1 commit into from Dec 12, 2013

Conversation

nebulade
Copy link
Contributor

No description provided.

Dynalon added a commit that referenced this pull request Dec 12, 2013
Iframe gimmick should be named 'iframe' instead of 'forkmeongithub'
@Dynalon Dynalon merged commit a98481b into Dynalon:master Dec 12, 2013
@Dynalon
Copy link
Owner

Dynalon commented Dec 12, 2013

Nice find. Although the name currently has no meaning and is not used. The iframe gimmick will work without this commit. Notice that it is undocumented because I didn't consider it 'production ready'

@nebulade
Copy link
Contributor Author

Ah, I didn't look any further in the code how it's used. So the actual name, to be used in the .md files, is the filename?

On a side note, I might miss something, but I couldn't find the documentation code repo which is backing http://www.mdwiki.info in case I would want to create a PR for it.

@Dynalon
Copy link
Owner

Dynalon commented Dec 12, 2013

The mdwiki.info website is just the gh-pages branch of MDwiki: https://github.com/Dynalon/mdwiki/tree/gh-pages This is how you do websites with GitHub, the gh-pages branch will be the website.

The iframe gimmick is included in latest mdwiki releases, to use it just put [gimmick: iframe](http://www.website-to-be-iframe.com) into the .md file. You can look at the source of the contributing/CLA section of MDwiki page which uses iframe gimmick to embed a google form: http://dynalon.github.io/mdwiki/#!contribute/cla-individual.md

@dirkk0
Copy link

dirkk0 commented Dec 23, 2013

Works like a charm here.

@dirkk0
Copy link

dirkk0 commented Dec 23, 2013

On second view - it seems to work for the first iframe. As soon as I add a second one or more, the iframes are 1 pixel high ... ?

@Dynalon
Copy link
Owner

Dynalon commented Dec 23, 2013

Yes, the iframe is designed so that only one iframe on a page exists. It tries to scale the iframe to the exact height of the browser window, for better integration.

The iframe gimmick is undocumented because I consider it still experimental. I added it because I want to include a blog somehow into the MDwiki page, but as you can see by the absence of this blog, it is right now not working as I want it to be.

@dirkk0
Copy link

dirkk0 commented Dec 23, 2013

That makes sense.
Is there a way to include raw HTML in the mean time? I intend to have small-ish jsFiddle iFrames spread over the page.

@Dynalon
Copy link
Owner

Dynalon commented Dec 23, 2013

You can insert regular HTML (to some extend) within your markdown. I.e., the mdwiki.info page includes a javascript inlined to load google analytics: http://dynalon.github.io/mdwiki/navigation.md

@dirkk0
Copy link

dirkk0 commented Dec 23, 2013

I see ... I could inject everything via JS. I try to do something like that, which might be working by injecting the iFrames:
http://jsfiddle.net/dirkk0/vtFQx/

@Dynalon
Copy link
Owner

Dynalon commented Dec 23, 2013

When you want to inject something via js, create a script tag and make sure you inject at the right time (after mdwiki is finished). You can do this like this:

    $.md.stage('gimmick').subscribe(function(done) {
        // do whatever you want here ...
        // ...

        // never forget to call done()!
        done();
    });

gimmick is a quite late stage, you can also subscribe to all_ready to make sure no other code interferes with yours. However, you css style is to generic (div { ... }), you should use named properties: #mydiv { ... } etc.

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