How to create interactive tags in html file?

I don't know anything about programming, so I'm trying to figure out where to start learning + how difficult my problem is. Since I do not have any programming knowledge, I will try to describe my problem in a natural language, I hope that everything is in order.

  • I have a criminal code html file (type of law). It contains many different rules, which are indicated in the clauses (§ 1, § 4, etc.).

  • Now I want to look at the source code and manually “tag” the paragraphs according to specific criteria. For example, all paragraphs relating to the use of weapons receive the tag “weapons” or have a minimum sentence of 1 year or more, receive a “criminal” tag, etc.

  • In the end, I want to view the interactive html file in Firefox / Chrome, where I could, for example, click the "crime" button, and all §§§ marked as "crime" will appear in bold red, leaving the rest of the document intact. Ideally, I could also click on “weapons” and see only “§§§” with the tag “weapons”, leaving the rest of the document.

The function is just for me, so it will only need to work on the Xubuntu 11.04 desktop with Firefox or Chrome. The original source file will be http://bundesrecht.juris.de/stgb/BJNR001270871.html . The code looks strange to me, is there a way to convert it to something easier to edit manually?

Any help would be greatly appreciated. First of all, I don’t know where to start learning. Do I need to know HTML, jQuery, or a programming language like Python? Do I need to configure Apache server on my PC? Perhaps because of my ignorance of programming, this seems like a not-so-complicated function. Am I mistaken in the belief that an amateur can build something like thins, maybe in a month?

+3
source share
2 answers

I think this is not very difficult to do, although the labeling process can be quite time consuming.

You do not need a lot of programming skills, especially if you want to tag material manually. You probably only need basic HTML and CSS and some Javascript to take this off.

I would do the following

  • HTML ( " " ).
  • §,
  • javascript §, .

1 , , 2. HTML , :

<div class="jnnorm" id="BJNR001270871BJNE009802307" title="Einzelnorm">
    <div class="jnheader">
        <a name="BJNR001270871BJNE009802307"/><a href="index.html#BJNR001270871BJNE009802307">Nichtamtliches Inhaltsverzeichnis</a>
        <h3><span class="jnenbez">&#167; 31</span>&#160;<span class="jnentitel">R&#252;cktritt vom Versuch der Beteiligung</span></h3>
    </div> 
    <div class="jnhtml">
        <div>
            <div class="jurAbsatz">
            (1) Nach &#167; 30 wird nicht bestraft, wer freiwillig etc.
            </div>
        </div>
    </div>
</div>

<div> jnnorm. , ( ):

<div class="jnnorm weapon" id="BJNR001270871BJNE009802307" title="Einzelnorm">

HTML. , .

3. , . html. HTML. , javascript, - , class. jQuery click event show hide.

jQuery

<ul id="menu">
  <li id="weapon">Weapons</li>
  <li id="crime">Crime</li> 
</ul>

jQuery

<script>
$(document).ready(function(){

  // When a <li> element inside an <ul> with the id "menu" is clicked, do the following
  $('ul#menu li').click(function(){
    // Get the id of the <li> element and append a '.' so we get the right name for the tag (class) we want to show 
    var tag = '.' + $(this).attr('id');
    // Hide all elements of class 'jnnorm'
    $('.jnnorm').hide();
    // Show all elements with the class name of tag we want
    $(tag).show();
  });
});
</script>

. HTML- .classname jQuery, HTML- #idname.

!

+3

, HTML/CSS Javascript, . JQuery javascript.

, :

  • CSS ""
  • onclick, JQuery, ( ).

HTML , . HTML/XML , , - , , , Perl, awk Python.

0

All Articles