Add a custom link to hudson project page - python

I'm using Hudson to generate the documentation for a Python project using Sphinx. This generates HTML documentation in the folder project/_build/html, which I set up to be used as an build artifact. Now after running the job, I can navigate to the documentation by clicking on the "Artifacts" link, then on the folder, and then on the index.html file. That's a bit cumbersome so I would like to customize the project page so I can have a "View Documentation" link that takes me straight to the index.html file. Is there any way to do that with hudson?

I know the question is closed, but I thought you could try this. You don't need a separate http server just to serve HTML documentation, artifact or not. You can use the plugin:
http://wiki.hudson-ci.org/display/HUDSON/HTML+Publisher+Plugin

The Project Description allows HTML, just edit it and place the link to your docs from the last successful build.

Get the sidelink plugin. That let's you add a link to the ones that are on the left-hand side of the project page.

Related

Django documenation page

I'm busy making a documentation page in my Django project and would like to make a dynamic page where theres a sidenav with links but if you click on a nav item it loads the page within the "master page aka the documentation page" without leaving that page
like so https://www.nbinteract.com/tutorial/tutorial_github_setup.html
I have created the side nav etc and it's working fine and linked my first URL to a nav item but if you click on the nav item, it opens that .html file instead of loading it within the main documentation page.
I would like to find a way to do it with Django only and not JavaScript if possible, any guidance would be appreciated.
Yes, this could be a silly question but please don't flame me about learning how to do stuff :)
The site you linked uses Javascript and you will need to use Javascript as well if you want to update only portions of the client-page with new data from the database.

How to exactly to programmatically copy paste content?

I try to create an automation web browser to post something. but i don't know how to copyy paste. the reason i want to copy paste. it simply copy all text include anchor. example reddit. if i put html tag anchor like
Example Anchor
it would not transcode to Example Anchor. but it ouput raw
Example Anchor
But, if i'm doing copy paste. example in below.
I'm an Example Anchor.
It Works.
the main thing why you need a browser that can copy paste behalf you but whatever actually i have not ever make a copy paste automation software but i know about a library called simple html dom for php that can do your work means you can get a text even can download photos using these library . after getting the text you can easily paste that text on whichever site you want but most of site easily can see that you are using a software or script and server will refuse to connect . you can use cURL library to achieve this task . using cURL library you can login into sites and can do your work but of course there are some limits . i do not know whether you know PHP or not but . this is easiest thing you can do without developing a whole browser .
here is the link of simple html dom Documentation https://simplehtmldom.sourceforge.io/
and here is the link of simple html dom library download link :
https://sourceforge.net/projects/simplehtmldom/
i hope this will hope you and future reader and googlers

Wagtail - extending PageChooserBlock to support external URLs

I'm building a site with Wagtail and using StreamField to build up content on a homepage. I've built a block that allows users to add featured links, which could be internal or external links. Currently the featured links have both a PageChooserBlock and a URLBlock, but I'd like to add a new custom block type that allows a user to specify either an internal page or a URL. I can't see anything in the docs that would help me. Any ideas where to start?
This is nothing Wagtail supports yet, but there's a lot of interest in this feature, see issue https://github.com/wagtail/wagtail/issues/3141.
To solve this there is a pull request work in progress (see https://github.com/wagtail/wagtail/pull/1645) that aims to unify link choosers.
Maybe you are able to contribute, I'm sure this would be very welcome!
you can use this library: https://pypi.org/project/wagtail-link-block/
From the docs:
"A link block to use as part of other StructBlocks which lets the user choose a link either to a Page, Document, or external URL, and whether or not they want the link to open in a new window."

Issues downloading full HTML of webpage with Python

I'm working on a project where I require the all of the game ID #'s found in the current scores section of http://www.nhl.com/ to download content/ parse stats for each game. I want to be able to get all current game ID's in one go, but for some reason, I'm unable to download the full HTML of the page, no matter how I try. I'm using requests and beautifulsoup4.
Here's my problem:
I've determined that the particular tags I'm interested in are div's where the CSS class = 'scrblk'. So, I wrote a function to pass into BeautifulSoup.find_all() to give me, specifically, blocks with that CSS class. It looks like this:
def find_scrblk(css_class):
return css_class is not None and css_class == 'scrblk'
so, when I actually went to the web page in Firefox and saved it, then loaded the saved file in beautifulsoup4, I did the following:
>>>soup = bs(open('nhl.html'))
>>>soup.find_all(class_=find_scrblk)
[<div class="scrblk" id="hsb2015010029"> <div class="defaultState"....]
and everything was all fine and dandy; I had all the info I needed. However, when I tried to download the page using any of several automated methods I know, this returned simply an empty list. Here's what I tried:
using requests.get() and saving the .text attribute in a file
using the iter_content() and iter_lines() methods of the request
object to write to the file piece by piece
using wget to download the page (through subprocess.call())
and open the resultant file. For this option, I was sure to use the --page-requisites and --convert-links flags so I downloaded (or so I thought)
all the necessary data.
With all of the above, I was unable to parse out the data that I need from the HTML files; it's as if they weren't being completely downloaded or something, but I have no idea what that something is or how to fix it. What am I doing wrong or missing here? I'm using python 2.7.9 on Ubuntu 15.04.
All of the files can be downloaded here:
https://www.dropbox.com/s/k6vv8hcxbkwy32b/nhl_html_examples.zip?dl=0
As the comments on your question state, you have to re-think your approach. What you see in the browser is not what the response contains. The site uses JavaScript to load the information you are after so you should look more carefully in the result what you get to find what you are looking for.
In the future to handle such problems try out Chrome's developer console and disable JavaScript and open a site such way. Then you will see if you are facing JS or the site would contain the values you are looking for.
And by the way what you do is against the Terms of Service of the NHL website (according to Section 2. Prohibited Content and Activities)
Engage in unauthorized spidering, scraping, or harvesting of content or information, or use any other unauthorized automated means to compile information;

Python : Can I do front end of django project using HTML / CSS?

Hi I am totally new to web development frameworks .I am currently learning python and django from the Django project tutorial..
My (rather dumb) question is when I am done with the small "poll" website will I be able to modify the front end of this project using HTML/CSS ?
Also, should I use tools like Dreamweaver to do that ? or are there other ways ?
Of course you will be able. That is the point of the web frameworks to let you build the whole application including frontend.
You'll get it all once you finish the tutorial. You'll see that Django has very nice templating language that allows you to build a html page according to data you get from your application.
<h1>{{ section.title }}</h1>
This result in normal HTML page in the end. And of course you can write any kind of CSS for those pages to get whatever look for your page you like.
Yes you can, you'll need to edit the templates in the location specified by TEMPLATE_DIRS. The templates are just html mixed with some python code to fill the content.

Categories

Resources