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

Added qutip-qip tutorials to documentation on Read the docs #206

Closed
wants to merge 2 commits into from

Conversation

rum1887
Copy link
Contributor

@rum1887 rum1887 commented May 28, 2023

Closes: Add qutip-qip tutorials to documentation on Read the docs #204
Did not add the examples in a gallery form like in Mitiq. can be converted to that form easily tho

Screenshot 2023-05-28 at 8 07 08 PM

Just added the links to the text

@rum1887
Copy link
Contributor Author

rum1887 commented May 28, 2023

This is the cropped .html file generated from qutip/tutorials
pr: qutip/qutip-tutorials#64
file: qutip-qip.html
have to render this in the qutip-qip tutorials section now

@rum1887
Copy link
Contributor Author

rum1887 commented May 28, 2023

hi , I have generated the html from qutip tutorials
qutip/qutip-tutorials#64

Planning on creating a python script to render the html to tutorials.rst

@rum1887
Copy link
Contributor Author

rum1887 commented May 28, 2023

hi, I have generated the HTML from qutip tutorials
qutip/qutip-tutorials#64

Planning on creating a Python script to render the HTML to tutorials.rst

I have created a file called html2rst.py which renders the HTML into .rst

This is the html2rst.py file

import subprocess

def convert_html_to_rst(html_file_path, rst_file_path):
   # Use the subprocess module to call the pandoc command-line tool
    subprocess.run(['pandoc', html_file_path, '-o', rst_file_path])

html_file_path = 'qutip-qip.html'
rst_file_path = 'tutorials.rst'
convert_html_to_rst(html_file_path, rst_file_path)

I'll have to provide the link to the html file generated previously from the qutip-qip tutorials. qutip/qutip-tutorials#64 file qutip-qip.html

I can locally generate the .html by running the script create_qutip-qip.py that I created by modifying the create_index.py.

But unless I run the create_qutip-qip.py , the HTML is not generated, I need a deployed HTML link from GitHub.

Even the index.html for the index file is not available on GitHub, I can create it locally by running the create_index.py script

@nathanshammah @BoxiLi any insights on how to add an HTML link that can be accessed?

Hope I communicated it clearly

This is the cropped local version of the tutorials doc after rendering the HTML(need to remove the header, footer and title):

Screenshot 2023-05-29 at 12 26 14 AM

@rum1887
Copy link
Contributor Author

rum1887 commented May 28, 2023

hi , I have generated the html from qutip tutorials
qutip/qutip-tutorials#64

Planning on creating a python script to render the html to tutorials.rst

I have created a file called html2rst.py which renders the html into .rst

This is the html2rst.py file

import subprocess

def convert_html_to_rst(html_file_path, rst_file_path):
   # Use the subprocess module to call the pandoc command-line tool
    subprocess.run(['pandoc', html_file_path, '-o', rst_file_path])

html_file_path = 'qutip-qip.html'
rst_file_path = 'tutorials.rst'
convert_html_to_rst(html_file_path, rst_file_path)

This is the cropped local version of the tutorials doc after rendering the html(need to remove the header , footer and title): Screenshot 2023-05-28 at 11 08 01 PM

I'll have to provide the link to the html file generated previously for the qutip-qip tutorials. qutip/qutip-tutorials#64 file qutip-qip.html

I can locally generate the .html by running the script create_qutip-qip.py that I created by modifying the create_index.py.

even the index.html for the index file is not available on the GitHub, when I run the create_index.py, I can locally generate the index.html

hope I communicated it well

@nathanshammah @BoxiLi how to add the HTML link, I can't find the index.html too on GitHub and I can't add a local link

TLDR:

  • Have created the cropped version of HTML using the jinja template (html file is created when the script is run)
  • Created Python script to render the HTML into the tutorial.rst (need the deployed .html so I can use the link)

Issue: Need to get the link

@BoxiLi
Copy link
Member

BoxiLi commented May 29, 2023

What you described sounds almost like a success.

I don't think we should push any code to qutip-tutorial. The files should be in qutip-qip.

The question is, do you really need the deployed HTML? If you can create it locally, you should be able to crop it from the file locally, or did I miss something?

I'm thinking more of something like this: The Python script is executed automatically when calling make html, which reads the source file from qutip-tutorial, generates the HTML locally, and then crops it to get the rst file. Do you think it is feasible?

@rum1887
Copy link
Contributor Author

rum1887 commented May 30, 2023

What you described sounds almost like a success.

I don't think we should push any code to qutip-tutorial. The files should be in qutip-qip.

The question is, do you really need the deployed HTML? If you can create it locally, you should be able to crop it from the file locally, or did I miss something?

I'm thinking more of something like this: The Python script is executed automatically when calling make html, which reads the source file from qutip-tutorial, generates the HTML locally, and then crops it to get the rst file. Do you think it is feasible?

Feasible, doing it rn!

@rum1887
Copy link
Contributor Author

rum1887 commented Jun 3, 2023

will close this pr!
new pr reopened at #207

@rum1887 rum1887 closed this Jun 3, 2023
@rum1887 rum1887 deleted the link branch June 4, 2023 18:58
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

Successfully merging this pull request may close these issues.

2 participants