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

Some example code is wrong. #2

Open
Changsung opened this issue Jan 24, 2017 · 1 comment
Open

Some example code is wrong. #2

Changsung opened this issue Jan 24, 2017 · 1 comment

Comments

@Changsung
Copy link

Changsung commented Jan 24, 2017

Hi, shon.

I found your open source on stack overflow. It seems to be interesting and useful.
But I tried to simulate your example code which is below, but it doesn't work as you described.

doc.body.content = tf.H1("The content")
print(doc)

<HTML>
    <BODY>
        <H1>The content</H1>
    </BODY>
</HTML>

I think it should be changed as follow.

doc = tf.HTML()
body = tf.body()
body.conent = tf.H1("The content")
doc.content = body
print  doc

If you know any great way to access the body contents as member variables which represented dot( '.'), please reply to this post.

Thank you!

@sqandr
Copy link

sqandr commented Mar 14, 2018

Your example worked for me but others didn't.
The "Hello sphc.more" produces an:
AttributeError: 'MyPage' object has no attribute 'nav_menu'

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

2 participants