Skip to content

Commit c0c8f8a

Browse files
Merge pull request #131 from kamranahmedse/master
Create a new pull request by comparing changes across two branches
2 parents feba6e5 + abad548 commit c0c8f8a

File tree

140 files changed

+9025
-66
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+9025
-66
lines changed
293 KB
Loading
106 KB
Binary file not shown.

public/roadmaps/data-analyst.png

1.54 MB
Loading

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Here is the list of available roadmaps with more being actively worked upon.
3939
- [Computer Science Roadmap](https://roadmap.sh/computer-science)
4040
- [Data Structures and Algorithms Roadmap](https://roadmap.sh/datastructures-and-algorithms)
4141
- [AI and Data Scientist Roadmap](https://roadmap.sh/ai-data-scientist)
42+
- [Data Analyst Roadmap](https://roadmap.sh/data-analyst)
4243
- [MLOps Roadmap](https://roadmap.sh/mlops)
4344
- [QA Roadmap](https://roadmap.sh/qa)
4445
- [Python Roadmap](https://roadmap.sh/python)

scripts/roadmap-content.cjs

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ function getFilesInFolder(folderPath, fileList = {}) {
4848
return fileList;
4949
}
5050

51+
/**
52+
* Write the topic content for the given topic
53+
* @param currTopicUrl
54+
* @returns {Promise<string>}
55+
*/
5156
function writeTopicContent(currTopicUrl) {
5257
const [parentTopic, childTopic] = currTopicUrl
5358
.replace(/^\d+-/g, '/')
@@ -59,9 +64,18 @@ function writeTopicContent(currTopicUrl) {
5964

6065
const roadmapTitle = roadmapId.replace(/-/g, ' ');
6166

62-
let prompt = `I am reading a guide about "${roadmapTitle}". I am on the topic "${parentTopic}". I want to know more about "${childTopic}". Write me a brief paragraph for that. Your output should be strictly markdown. Do not include anything other than the description in your output. I already know the benefits of each so do not add benefits in the output.`;
67+
let prompt = `I will give you a topic and you need to write a brief introduction for that with regards to "${roadmapTitle}". Your format should be as follows and be in strictly markdown format:
68+
69+
# (Put a heading for the topic)
70+
71+
(Write me a brief introduction for the topic with regards to "${roadmapTitle}")
72+
73+
`;
74+
6375
if (!childTopic) {
64-
prompt = `I am reading a guide about "${roadmapTitle}". I am on the topic "${parentTopic}". I want to know more about "${parentTopic}". Write me a brief paragraph for that. Your output should be strictly markdown. Do not include anything other than the description in your output. I already know the benefits of each so do not add benefits in the output.`;
76+
prompt += `First topic is: ${parentTopic}`;
77+
} else {
78+
prompt += `First topic is: ${childTopic} under ${parentTopic}`;
6579
}
6680

6781
console.log(`Generating '${childTopic || parentTopic}'...`);
@@ -123,10 +137,9 @@ async function writeFileForGroup(group, topicUrlToPathMapping) {
123137
}
124138

125139
const topicContent = await writeTopicContent(currTopicUrl);
126-
newFileContent += `\n\n${topicContent}`;
127140

128141
console.log(`Writing ${topicId}..`);
129-
fs.writeFileSync(contentFilePath, newFileContent, 'utf8');
142+
fs.writeFileSync(contentFilePath, topicContent, 'utf8');
130143

131144
// console.log(currentFileContent);
132145
// console.log(currTopicUrl);

src/components/GenerateRoadmap/AITermSuggestionInput.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ export function AITermSuggestionInput(props: AITermSuggestionInputProps) {
246246
key={result?._id}
247247
type="button"
248248
className={cn(
249-
'flex w-full items-center rounded p-2 text-sm',
249+
'flex w-full items-start rounded p-2 text-left text-sm',
250250
counter === activeCounter ? 'bg-gray-100' : '',
251251
)}
252252
onMouseOver={() => setActiveCounter(counter)}
@@ -264,7 +264,7 @@ export function AITermSuggestionInput(props: AITermSuggestionInputProps) {
264264
>
265265
<span
266266
className={cn(
267-
'mr-2 rounded-full p-1 px-1.5 text-xs leading-none',
267+
'mr-2 whitespace-nowrap rounded-full p-1 px-1.5 text-xs leading-none',
268268
result.isOfficial
269269
? 'bg-green-500 text-green-50'
270270
: 'bg-blue-400 text-blue-50',

src/components/GenerateRoadmap/GenerateRoadmap.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ export function GenerateRoadmap() {
113113
const [roadmapTopicLimitUsed, setRoadmapTopicLimitUsed] = useState(0);
114114
const [isConfiguring, setIsConfiguring] = useState(false);
115115

116-
const [openAPIKey, setOpenAPIKey] = useState<string | undefined>(getOpenAIKey());
116+
const [openAPIKey, setOpenAPIKey] = useState<string | undefined>(
117+
getOpenAIKey(),
118+
);
117119
const isKeyOnly = IS_KEY_ONLY_ROADMAP_GENERATION;
118120
const isAuthenticatedUser = isLoggedIn();
119121

@@ -658,26 +660,26 @@ export function GenerateRoadmap() {
658660
</div>
659661
<div
660662
className={cn({
661-
'relative mb-20 max-h-[800px] min-h-[800px] sm:max-h-[1000px] md:min-h-[1000px] lg:max-h-[1200px] lg:min-h-[1200px] overflow-hidden':
663+
'relative mb-20 max-h-[800px] min-h-[800px] overflow-hidden sm:max-h-[1000px] md:min-h-[1000px] lg:max-h-[1200px] lg:min-h-[1200px]':
662664
!isAuthenticatedUser,
663665
})}
664666
>
665667
<div
666668
ref={roadmapContainerRef}
667669
id="roadmap-container"
668670
onClick={handleNodeClick}
669-
className="relative px-4 py-5 [&>svg]:mx-auto [&>svg]:max-w-[1300px]"
671+
className="relative min-h-[400px] px-4 py-5 [&>svg]:mx-auto [&>svg]:max-w-[1300px]"
670672
/>
671673
{!isAuthenticatedUser && (
672674
<div className="absolute bottom-0 left-0 right-0">
673675
<div className="h-80 w-full bg-gradient-to-t from-gray-100 to-transparent" />
674676
<div className="bg-gray-100">
675-
<div className="mx-auto px-5 max-w-[600px] flex-col items-center justify-center bg-gray-100 pt-px">
677+
<div className="mx-auto max-w-[600px] flex-col items-center justify-center bg-gray-100 px-5 pt-px">
676678
<div className="mt-8 text-center">
677-
<h2 className="mb-0.5 sm:mb-3 text-xl sm:text-2xl font-medium">
679+
<h2 className="mb-0.5 text-xl font-medium sm:mb-3 sm:text-2xl">
678680
Sign up to View the full roadmap
679681
</h2>
680-
<p className="mb-6 text-sm sm:text-base text-gray-600 text-balance">
682+
<p className="mb-6 text-balance text-sm text-gray-600 sm:text-base">
681683
You must be logged in to view the complete roadmap
682684
</p>
683685
</div>

src/components/GenerateRoadmap/RoadmapSearch.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export function RoadmapSearch(props: RoadmapSearchProps) {
4545
const randomTerms = ['OAuth', 'APIs', 'UX Design', 'gRPC'];
4646

4747
return (
48-
<div className="flex flex-grow flex-col items-center px-4 py-6 sm:px-6">
48+
<div className="flex flex-grow flex-col items-center px-4 py-6 sm:px-6 md:my-24 lg:my-32">
4949
{isConfiguring && (
5050
<IncreaseRoadmapLimit
5151
onClose={() => {
@@ -55,7 +55,7 @@ export function RoadmapSearch(props: RoadmapSearchProps) {
5555
}}
5656
/>
5757
)}
58-
<div className="flex flex-col gap-0 text-center sm:gap-2 md:mt-24 lg:mt-32">
58+
<div className="flex flex-col gap-0 text-center sm:gap-2">
5959
<h1 className="relative text-2xl font-medium sm:text-3xl">
6060
<span className="hidden sm:inline">Generate roadmaps with AI</span>
6161
<span className="inline sm:hidden">AI Roadmap Generator</span>

src/components/GetStarted/RoleRoadmaps.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function RoleRoadmaps(props: RoleRoadmapsProps) {
1818
<SectionBadge title={badge} />
1919
</div>
2020
<div className="my-4 sm:my-7 text-left">
21-
<h2 className="mb-1 text-xl sm:text-3xl font-semibold">{title}</h2>
21+
<h2 className="mb-1 text-balance text-xl sm:text-3xl font-semibold">{title}</h2>
2222
<p className="text-sm sm:text-base text-gray-500">{description}</p>
2323

2424
<div className="mt-4 sm:mt-7 grid sm:grid-cols-2 md:grid-cols-3 gap-3">{children}</div>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
import { getGuideTableOfContent, type GuideFileType } from '../../lib/guide';
3+
import MarkdownFile from '../MarkdownFile.astro';
4+
import { TableOfContent } from '../TableOfContent/TableOfContent';
5+
6+
interface Props {
7+
guide: GuideFileType;
8+
}
9+
10+
const { guide } = Astro.props;
11+
12+
const allHeadings = guide.getHeadings();
13+
const tableOfContent = getGuideTableOfContent(allHeadings);
14+
15+
const showTableOfContent = tableOfContent.length > 0;
16+
const { frontmatter: guideFrontmatter, author } = guide;
17+
---
18+
19+
<article class='lg:grid lg:max-w-full lg:grid-cols-[1fr_minmax(0,700px)_1fr]'>
20+
{
21+
showTableOfContent && (
22+
<div class='bg-gradient-to-r from-gray-50 py-0 lg:col-start-3 lg:col-end-4 lg:row-start-1'>
23+
<TableOfContent toc={tableOfContent} client:load />
24+
</div>
25+
)
26+
}
27+
28+
<div
29+
class:list={['col-start-2 col-end-3 row-start-1 mx-auto max-w-[700px] py-5 sm:py-10', {
30+
'lg:border-r': showTableOfContent
31+
}]}
32+
>
33+
<MarkdownFile>
34+
<h1 class='text-balance text-4xl mb-3 font-bold'>{guideFrontmatter.title}</h1>
35+
<p
36+
class='flex items-center justify-start text-sm text-gray-400 my-0'
37+
>
38+
<a
39+
href={`/authors/${author.id}`}
40+
class='inline-flex items-center font-medium hover:text-gray-600 hover:underline underline-offset-2'
41+
>
42+
<img
43+
alt={author.frontmatter.name}
44+
src={author.frontmatter.imageUrl}
45+
class='mb-0 mr-2 inline h-5 w-5 rounded-full'
46+
/>
47+
{author.frontmatter.name}
48+
</a>
49+
<span class='mx-2 hidden sm:inline'>&middot;</span>
50+
<a
51+
class='hover:text-gray-600 underline-offset-2 hidden sm:inline'
52+
href={`https://github.com/kamranahmedse/developer-roadmap/tree/master/src/data/guides/${guide.id}.md`}
53+
target='_blank'
54+
>
55+
Improve this Guide
56+
</a>
57+
</p>
58+
<guide.Content />
59+
</MarkdownFile>
60+
</div>
61+
</article>

0 commit comments

Comments
 (0)