Created
April 10, 2020 17:55
-
-
Save arsho/ab43e3388dfab160a31fec15925dbd43 to your computer and use it in GitHub Desktop.
Extract features and generate readme list from https://www.django-cms.org/en/features/list/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$count_section = 1; | |
$count_subsection = 1; | |
$self_service = "Self service"; | |
$third_party = "Via add-ons or third-party services"; | |
$final_string = ""; | |
$(".table tr").each(function(item, data){ | |
$tr = $(this); | |
if($tr.attr("class") == "active"){ | |
$section_title = $tr.children("td:first").text(); | |
$final_string += $count_section+". #### "+$section_title+":"+"\n"; | |
$count_section++; | |
$count_subsection = 1; | |
} | |
else{ | |
$subsection_title = $tr.children("td:first").text(); | |
$td_value = $tr.children("td:nth-child(2)").text();; | |
if($td_value == "●"){ | |
$value = $self_service; | |
} | |
else if($td_value == "○"){ | |
$value = $third_party; | |
} | |
else{ | |
$value = $td_value; | |
} | |
$final_string += " "+$count_subsection+". <b>"+$subsection_title+"</b>: "+$value+"\n"; | |
$count_subsection++; | |
} | |
}) | |
console.log($final_string); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment