- Dynamically generate javascript files so that you can html parts of your web pages and copy them with css to load them from your blog or other web pages
- You can synchronize parts of a specific page in real time when you are writing scripts that allow blogs, cafes, and so on.
- The basic idea is a lot of gist's javascript embed tag.
-
Select source webpage url
https://github.com/dotnet/core/blob/master/README.md
- For example, select the dotnet core README.md page.
-
Element selection
//article
- Select the elements to synchronize to the xpath syntax.
- For example, select
<article>
from the entire html document.
-
Generate a javascript-generating url by urlencoding the source webpage url and element xpath
https://htmlpartitionsync.azurewebsites.net/api/PartitionJs?url=https%3A%2F%2Fgithub.com%2Fdotnet%2Fcore%2Fblob%2Fmaster%2FREADME.md&xpath=%252F%252Farticle
-
Insert a script tag into your target web page
<div>Here is the blog post area ...</div> <div><br /></div> <div>From the bottom, <a href="https://github.com/dotnet/core/blob/master/README.md">https://github.com/dotnet/core/blob/master/README.md</a> will only render part of the article.</div> <div>start ...</div> <div><br /></div> <div><br /></div> <script src="https://htmlpartitionsync.azurewebsites.net/api/PartitionJs?url=https%3A%2F%2Fgithub.com%2Fdotnet%2Fcore%2Fblob%2Fmaster%2FREADME.md&xpath=%252F%252Farticle"></script> <div><br /></div> <div>finish ...</div>
- What is xpath syntax?